https://github.com/mvdan/editorconfig
EditorConfig support in Go
https://github.com/mvdan/editorconfig
editorconfig go golang
Last synced: 4 months ago
JSON representation
EditorConfig support in Go
- Host: GitHub
- URL: https://github.com/mvdan/editorconfig
- Owner: mvdan
- License: bsd-3-clause
- Created: 2019-10-01T13:27:02.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2025-02-22T14:39:06.000Z (over 1 year ago)
- Last Synced: 2025-08-14T07:30:59.031Z (11 months ago)
- Topics: editorconfig, go, golang
- Language: Go
- Homepage: https://editorconfig.org/
- Size: 33.2 KB
- Stars: 11
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# editorconfig
[](https://godoc.org/mvdan.cc/editorconfig)
A small package to parse and use [EditorConfig][1] files. Currently passes all
of the official [test cases][2], which are run via `go test`.
```go
props, err := editorconfig.Find("path/to/file.go")
if err != nil { ... }
// Print all the properties
fmt.Println(props)
// Query specific ones
fmt.Println(props.Get("indent_style"))
fmt.Println(props.IndentSize())
```
Note that an [official library][3] exists for Go. This alternative
implementation started with a different design:
* Specialised INI parser, for full compatibility with the spec
* Ability to cache parsing files and compiling pattern matches
* Storing and querying all properties equally
* Minimising pointers and maps to store data
[1]: https://editorconfig.org/
[2]: https://github.com/editorconfig/editorconfig-core-test
[3]: https://github.com/editorconfig/editorconfig-core-go