{"id":37149070,"url":"https://github.com/robotn/toml","last_synced_at":"2026-01-14T17:36:19.972Z","repository":{"id":57590291,"uuid":"140455455","full_name":"robotn/toml","owner":"robotn","description":"TOML parser for Golang with reflection.","archived":false,"fork":true,"pushed_at":"2018-11-14T16:11:39.000Z","size":299,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-06-20T02:13:15.602Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"BurntSushi/toml","license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/robotn.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"COPYING","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-07-10T15:50:43.000Z","updated_at":"2024-06-20T02:13:15.603Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/robotn/toml","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/robotn/toml","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robotn%2Ftoml","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robotn%2Ftoml/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robotn%2Ftoml/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robotn%2Ftoml/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/robotn","download_url":"https://codeload.github.com/robotn/toml/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robotn%2Ftoml/sbom","scorecard":{"id":781191,"data":{"date":"2025-08-11","repo":{"name":"github.com/robotn/toml","commit":"3012a1dbe2e4bd1391d42b32f0577cb7bbc7f005"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Code-Review","score":0,"reason":"Found 0/30 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: COPYING:0","Info: FSF or OSI recognized license: MIT License: COPYING:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}}]},"last_synced_at":"2025-08-23T04:57:32.283Z","repository_id":57590291,"created_at":"2025-08-23T04:57:32.283Z","updated_at":"2025-08-23T04:57:32.283Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28428821,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T16:38:47.836Z","status":"ssl_error","status_checked_at":"2026-01-14T16:34:59.695Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-01-14T17:36:19.408Z","updated_at":"2026-01-14T17:36:19.963Z","avatar_url":"https://github.com/robotn.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"## TOML parser and encoder for Go with reflection\n\nTOML stands for Tom's Obvious, Minimal Language. This Go package provides a\nreflection interface similar to Go's standard library `json` and `xml`\npackages. This package also supports the `encoding.TextUnmarshaler` and\n`encoding.TextMarshaler` interfaces so that you can define custom data\nrepresentations. (There is an example of this below.)\n\nSpec: https://github.com/toml-lang/toml\n\nCompatible with TOML version\n[v0.4.0](https://github.com/toml-lang/toml/blob/master/versions/en/toml-v0.4.0.md)\n\nDocumentation: https://godoc.org/github.com/BurntSushi/toml\n\nInstallation:\n\n```bash\ngo get github.com/BurntSushi/toml\n```\n\nTry the toml validator:\n\n```bash\ngo get github.com/BurntSushi/toml/cmd/tomlv\ntomlv some-toml-file.toml\n```\n\n[![Build Status](https://travis-ci.org/BurntSushi/toml.svg?branch=master)](https://travis-ci.org/BurntSushi/toml) [![GoDoc](https://godoc.org/github.com/BurntSushi/toml?status.svg)](https://godoc.org/github.com/BurntSushi/toml)\n\n### Testing\n\nThis package passes all tests in\n[toml-test](https://github.com/BurntSushi/toml-test) for both the decoder\nand the encoder.\n\n### Examples\n\nThis package works similarly to how the Go standard library handles `XML`\nand `JSON`. Namely, data is loaded into Go values via reflection.\n\nFor the simplest example, consider some TOML file as just a list of keys\nand values:\n\n```toml\nAge = 25\nCats = [ \"Cauchy\", \"Plato\" ]\nPi = 3.14\nPerfection = [ 6, 28, 496, 8128 ]\nDOB = 1987-07-05T05:45:00Z\n```\n\nWhich could be defined in Go as:\n\n```go\ntype Config struct {\n  Age int\n  Cats []string\n  Pi float64\n  Perfection []int\n  DOB time.Time // requires `import time`\n}\n```\n\nAnd then decoded with:\n\n```go\nvar conf Config\nif _, err := toml.Decode(tomlData, \u0026conf); err != nil {\n  // handle error\n}\n```\n\nYou can also use struct tags if your struct field name doesn't map to a TOML\nkey value directly:\n\n```toml\nsome_key_NAME = \"wat\"\n```\n\n```go\ntype TOML struct {\n  ObscureKey string `toml:\"some_key_NAME\"`\n}\n```\n\n### Using the `encoding.TextUnmarshaler` interface\n\nHere's an example that automatically parses duration strings into\n`time.Duration` values:\n\n```toml\n[[song]]\nname = \"Thunder Road\"\nduration = \"4m49s\"\n\n[[song]]\nname = \"Stairway to Heaven\"\nduration = \"8m03s\"\n```\n\nWhich can be decoded with:\n\n```go\ntype song struct {\n  Name     string\n  Duration duration\n}\ntype songs struct {\n  Song []song\n}\nvar favorites songs\nif _, err := toml.Decode(blob, \u0026favorites); err != nil {\n  log.Fatal(err)\n}\n\nfor _, s := range favorites.Song {\n  fmt.Printf(\"%s (%s)\\n\", s.Name, s.Duration)\n}\n```\n\nAnd you'll also need a `duration` type that satisfies the\n`encoding.TextUnmarshaler` interface:\n\n```go\ntype duration struct {\n\ttime.Duration\n}\n\nfunc (d *duration) UnmarshalText(text []byte) error {\n\tvar err error\n\td.Duration, err = time.ParseDuration(string(text))\n\treturn err\n}\n```\n\n### More complex usage\n\nHere's an example of how to load the example from the official spec page:\n\n```toml\n# This is a TOML document. Boom.\n\ntitle = \"TOML Example\"\n\n[owner]\nname = \"Tom Preston-Werner\"\norganization = \"GitHub\"\nbio = \"GitHub Cofounder \u0026 CEO\\nLikes tater tots and beer.\"\ndob = 1979-05-27T07:32:00Z # First class dates? Why not?\n\n[database]\nserver = \"192.168.1.1\"\nports = [ 8001, 8001, 8002 ]\nconnection_max = 5000\nenabled = true\n\n[servers]\n\n  # You can indent as you please. Tabs or spaces. TOML don't care.\n  [servers.alpha]\n  ip = \"10.0.0.1\"\n  dc = \"eqdc10\"\n\n  [servers.beta]\n  ip = \"10.0.0.2\"\n  dc = \"eqdc10\"\n\n[clients]\ndata = [ [\"gamma\", \"delta\"], [1, 2] ] # just an update to make sure parsers support it\n\n# Line breaks are OK when inside arrays\nhosts = [\n  \"alpha\",\n  \"omega\"\n]\n```\n\nAnd the corresponding Go types are:\n\n```go\ntype tomlConfig struct {\n\tTitle string\n\tOwner ownerInfo\n\tDB database `toml:\"database\"`\n\tServers map[string]server\n\tClients clients\n}\n\ntype ownerInfo struct {\n\tName string\n\tOrg string `toml:\"organization\"`\n\tBio string\n\tDOB time.Time\n}\n\ntype database struct {\n\tServer string\n\tPorts []int\n\tConnMax int `toml:\"connection_max\"`\n\tEnabled bool\n}\n\ntype server struct {\n\tIP string\n\tDC string\n}\n\ntype clients struct {\n\tData [][]interface{}\n\tHosts []string\n}\n```\n\nNote that a case insensitive match will be tried if an exact match can't be\nfound.\n\nA working example of the above can be found in `_examples/example.{go,toml}`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frobotn%2Ftoml","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frobotn%2Ftoml","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frobotn%2Ftoml/lists"}