https://github.com/go-viper/mapstructure
Score: 24.921082828272187
Last synced: about 22 hours ago
JSON representation
Repository metadata:
Go library for decoding generic map values into native Go structures and vice versa.
- Host: GitHub
- URL: https://github.com/go-viper/mapstructure
- Owner: go-viper
- License: mit
- Fork: true (mitchellh/mapstructure)
- Created: 2023-12-18T15:19:52.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2026-05-04T05:01:02.000Z (about 1 month ago)
- Last Synced: 2026-06-05T00:07:49.660Z (9 days ago)
- Language: Go
- Homepage:
- Size: 630 KB
- Stars: 470
- Watchers: 0
- Forks: 42
- Open Issues: 34
Owner metadata:
- Name: Viper
- Login: go-viper
- Email:
- Kind: organization
- Description: Go configuration with fangs
- Website:
- Location:
- Twitter:
- Company:
- Icon url: https://avatars.githubusercontent.com/u/72136025?v=4
- Repositories: 1
- Last Synced at: 2023-12-18T17:07:18.846Z
- Profile URL: https://github.com/go-viper
GitHub Events
Total
- Commit comment event: 2
- Create event: 54
- Delete event: 48
- Fork event: 18
- Issue comment event: 86
- Issues event: 21
- Pull request event: 146
- Pull request review comment event: 15
- Pull request review event: 40
- Push event: 39
- Release event: 2
- Watch event: 212
- Total: 683
Last Year
- Commit comment event: 2
- Create event: 33
- Delete event: 28
- Fork event: 5
- Issue comment event: 47
- Issues event: 9
- Pull request event: 85
- Pull request review comment event: 7
- Pull request review event: 17
- Push event: 24
- Release event: 2
- Watch event: 60
- Total: 319
Committers metadata
Last synced: 3 days ago
Total Commits: 374
Total Committers: 91
Avg Commits per committer: 4.11
Development Distribution Score (DDS): 0.596
Commits in past year: 57
Committers in past year: 12
Avg Commits per committer in past year: 4.75
Development Distribution Score (DDS) in past year: 0.561
| Name | Commits | |
|---|---|---|
| Mitchell Hashimoto | m****o@g****m | 151 |
| Mark Sagi-Kazar | m****r@g****m | 59 |
| dependabot[bot] | 4****] | 38 |
| Mahad Zaryab | m****1@g****m | 4 |
| Yuri Shkuro | g****b@y****s | 4 |
| Calvin Leung Huang | c****0@g****m | 4 |
| tlipoca9 | t****9@g****m | 3 |
| Sebastian Widmer | s****r@t****h | 3 |
| Ryan Uber | r****u@r****m | 3 |
| Miroslav Šedivý | s****o@g****m | 3 |
| Aleksander Kochetkov | s****4@g****m | 2 |
| Ayrat Sadreev | a****t@c****i | 2 |
| Carlo Hamalainen | c****o@c****t | 2 |
| Daniel Nephin | d****n@g****m | 2 |
| Gernot Eger | g****r@g****m | 2 |
| James Nugent | j****s@j****m | 2 |
| Jan Larwig | j****n@l****m | 2 |
| Mark Costello | m****k@m****t | 2 |
| Matt Keeler | m****7@g****m | 2 |
| Michael Kuc | m****6@g****m | 2 |
| Rostislav | r****d@g****m | 2 |
| Shunsuke Suzuki | s****9@g****m | 2 |
| Tiago Peczenyj | t****j@g****m | 2 |
| Vladimir Skipor | s****r@y****u | 2 |
| felipe.ramos | f****s@c****m | 2 |
| Buğra Özgürsoy | b****r@g****m | 2 |
| Akos Gyimesi | g****s@g****m | 2 |
| Fabrice Vaillant | f****t@a****m | 2 |
| Jimmy Spagnola | j****a@c****i | 2 |
| Zhao Jiangkun | j****o@e****e | 2 |
| and 61 more... | ||
Issue and Pull Request metadata
Last synced: 3 days ago
Total issues: 28
Total pull requests: 80
Average time to close issues: about 1 month
Average time to close pull requests: 21 days
Total issue authors: 26
Total pull request authors: 24
Average comments per issue: 0.29
Average comments per pull request: 0.43
Merged pull request: 35
Bot issues: 2
Bot pull requests: 45
Past year issues: 8
Past year pull requests: 30
Past year average time to close issues: 18 days
Past year average time to close pull requests: 8 days
Past year issue authors: 8
Past year pull request authors: 8
Past year average comments per issue: 0.13
Past year average comments per pull request: 0.4
Past year merged pull request: 8
Past year bot issues: 1
Past year bot pull requests: 21
Top Issue Authors
- dependabot[bot] (2)
- andig (2)
- garrettladley (1)
- skaggmannen (1)
- Succo (1)
- bminer (1)
- pcfreak30 (1)
- veqryn (1)
- yurishkuro (1)
- vincentbernat (1)
- cipherboy (1)
- weeco (1)
- ZoeySimone (1)
- xyzdev-cell (1)
- tkrop (1)
Top Pull Request Authors
- dependabot[bot] (45)
- sagikazarmark (9)
- baagod (3)
- m1k1o (2)
- mahadzaryab1 (2)
- skaggmannen (1)
- tklauser (1)
- peczenyj (1)
- yurishkuro (1)
- triarius (1)
- jmacd (1)
- ZoeySimone (1)
- rostislaved (1)
- dpeckett (1)
- tlipoca9 (1)
Top Issue Labels
- github_actions (2)
- dependencies (2)
Top Pull Request Labels
- github_actions (45)
- dependencies (45)
- enhancement (3)
Package metadata
- Total packages: 8
- Total downloads: unknown
- Total docker downloads: 1,450,826
- Total dependent packages: 0 (may contain duplicates)
- Total dependent repositories: 0 (may contain duplicates)
- Total versions: 69
- Total advisories: 3
proxy.golang.org: github.com/go-viper/mapstructure/v2/internal/errors
- Homepage: https://github.com/go-viper/mapstructure
- Documentation: https://pkg.go.dev/github.com/go-viper/mapstructure/v2/internal/errors#section-documentation
- Licenses: MIT
- Latest release: v2.5.0 (published about 1 month ago)
- Last Synced: 2026-06-10T19:01:50.734Z (3 days ago)
- Versions: 7
- Dependent Packages: 0
- Dependent Repositories: 0
-
Rankings:
- Dependent packages count: 4.76%
- Average: 4.92%
- Dependent repos count: 5.08%
proxy.golang.org: github.com/go-vipeR/mapstructure/v2
- Homepage:
- Documentation: https://pkg.go.dev/github.com/go-vipeR/mapstructure/v2#section-documentation
- Licenses:
- Latest release: v2.5.0 (published 5 months ago)
- Last Synced: 2026-06-10T19:01:52.953Z (3 days ago)
- Versions: 8
- Dependent Packages: 0
- Dependent Repositories: 0
-
Rankings:
- Dependent packages count: 5.048%
- Average: 5.218%
- Dependent repos count: 5.387%
proxy.golang.org: github.com/go-vipeR/mapstructure
- Homepage:
- Documentation: https://pkg.go.dev/github.com/go-vipeR/mapstructure#section-documentation
- Licenses:
- Latest release: v1.6.0 (published over 2 years ago)
- Last Synced: 2026-06-10T19:01:56.513Z (3 days ago)
- Versions: 18
- Dependent Packages: 0
- Dependent Repositories: 0
-
Rankings:
- Dependent packages count: 5.048%
- Average: 5.218%
- Dependent repos count: 5.387%
proxy.golang.org: github.com/go-Viper/mapstructure/v2
- Homepage:
- Documentation: https://pkg.go.dev/github.com/go-Viper/mapstructure/v2#section-documentation
- Licenses: mit
- Latest release: v2.5.0 (published 5 months ago)
- Last Synced: 2026-06-10T19:01:54.418Z (3 days ago)
- Versions: 8
- Dependent Packages: 0
- Dependent Repositories: 0
-
Rankings:
- Dependent packages count: 5.369%
- Average: 5.549%
- Dependent repos count: 5.729%
proxy.golang.org: github.com/go-viper/mapstructure
Package mapstructure exposes functionality to convert one arbitrary Go type into another, typically to convert a map[string]interface{} into a native Go structure. The Go structure can be arbitrarily complex, containing slices, other structs, etc. and the decoder will properly decode nested maps and so on into the proper structures in the native Go struct. See the examples to see what the decoder is capable of. The simplest function to start with is Decode. When decoding to a struct, mapstructure will use the field name by default to perform the mapping. For example, if a struct has a field "Username" then mapstructure will look for a key in the source value of "username" (case insensitive). You can change the behavior of mapstructure by using struct tags. The default struct tag that mapstructure looks for is "mapstructure" but you can customize it using DecoderConfig. To rename the key that mapstructure looks for, use the "mapstructure" tag and set a value directly. For example, to change the "username" example above to "user": Embedded structs are treated as if they're another field with that name. By default, the two structs below are equivalent when decoding with mapstructure: This would require an input that looks like below: If your "person" value is NOT nested, then you can append ",squash" to your tag value and mapstructure will treat it as if the embedded struct were part of the struct directly. Example: Now the following input would be accepted: When decoding from a struct to a map, the squash tag squashes the struct fields into a single map. Using the example structs from above: Will be decoded into a map: DecoderConfig has a field that changes the behavior of mapstructure to always squash embedded structs. If there are any unmapped keys in the source value, mapstructure by default will silently ignore them. You can error by setting ErrorUnused in DecoderConfig. If you're using Metadata you can also maintain a slice of the unused keys. You can also use the ",remain" suffix on your tag to collect all unused values in a map. The field with this tag MUST be a map type and should probably be a "map[string]interface{}" or "map[interface{}]interface{}". See example below: Given the input below, Other would be populated with the other values that weren't used (everything but "name"): When decoding from a struct to any other value, you may use the ",omitempty" suffix on your tag to omit that value if it equates to the zero value. The zero value of all types is specified in the Go specification. For example, the zero type of a numeric type is zero ("0"). If the struct field value is zero and a numeric type, the field is empty, and it won't be encoded into the destination type. Since unexported (private) struct fields cannot be set outside the package where they are defined, the decoder will simply skip them. For this output type definition: Using this map as input: The following struct will be decoded: mapstructure is highly configurable. See the DecoderConfig struct for other features and options that are supported.
- Homepage: https://github.com/mitchellh/mapstructure
- Documentation: https://pkg.go.dev/github.com/go-viper/mapstructure#section-documentation
- Licenses: MIT
- Latest release: v1.6.0 (published over 2 years ago)
- Last Synced: 2026-06-10T19:01:50.412Z (3 days ago)
- Versions: 18
- Dependent Packages: 0
- Dependent Repositories: 0
- Docker Downloads: 342
-
Rankings:
- Dependent packages count: 9.52%
- Average: 10.128%
- Dependent repos count: 10.735%
proxy.golang.org: github.com/go-viper/mapstructure/v2
Package mapstructure exposes functionality to convert one arbitrary Go type into another, typically to convert a map[string]any into a native Go structure.
- Homepage: https://github.com/go-viper/mapstructure
- Documentation: https://pkg.go.dev/github.com/go-viper/mapstructure/v2#section-documentation
- Licenses: MIT
- Latest release: v2.5.0 (published 5 months ago)
- Last Synced: 2026-06-10T19:01:55.966Z (3 days ago)
- Versions: 8
- Dependent Packages: 0
- Dependent Repositories: 0
- Docker Downloads: 1,450,484
-
Rankings:
- Dependent packages count: 9.52%
- Average: 10.128%
- Dependent repos count: 10.735%
- Advisories:
debian-13: golang-github-go-viper-mapstructure
- Homepage: https://github.com/go-viper/mapstructure
- Documentation: https://packages.debian.org/trixie/golang-github-go-viper-mapstructure
- Licenses:
- Latest release: 2.2.1-1 (published 4 months ago)
- Last Synced: 2026-03-13T11:15:13.195Z (3 months ago)
- Versions: 1
- Dependent Packages: 0
- Dependent Repositories: 0
-
Rankings:
- Dependent repos count: 0.0%
- Dependent packages count: 0.0%
- Average: 100%
guix: go-github-com-go-viper-mapstructure-v2
Go type converters
- Homepage: https://github.com/go-viper/mapstructure
- Documentation: https://git.savannah.gnu.org/cgit/guix.git/tree/gnu/packages/golang-xyz.scm#n10930
- Licenses: expat
- Latest release: 2.2.1 (published 3 months ago)
- Last Synced: 2026-04-07T00:02:22.853Z (2 months ago)
- Versions: 1
- Dependent Packages: 0
- Dependent Repositories: 0
-
Rankings:
- Dependent repos count: 0.0%
- Dependent packages count: 0.0%
- Average: 100%