You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

README.md 2.0 kB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. INI [![Build Status](https://travis-ci.org/go-ini/ini.svg?branch=master)](https://travis-ci.org/go-ini/ini) [![Sourcegraph](https://img.shields.io/badge/view%20on-Sourcegraph-brightgreen.svg)](https://sourcegraph.com/github.com/go-ini/ini)
  2. ===
  3. ![](https://avatars0.githubusercontent.com/u/10216035?v=3&s=200)
  4. Package ini provides INI file read and write functionality in Go.
  5. ## Features
  6. - Load from multiple data sources(`[]byte`, file and `io.ReadCloser`) with overwrites.
  7. - Read with recursion values.
  8. - Read with parent-child sections.
  9. - Read with auto-increment key names.
  10. - Read with multiple-line values.
  11. - Read with tons of helper methods.
  12. - Read and convert values to Go types.
  13. - Read and **WRITE** comments of sections and keys.
  14. - Manipulate sections, keys and comments with ease.
  15. - Keep sections and keys in order as you parse and save.
  16. ## Installation
  17. The minimum requirement of Go is **1.6**.
  18. ```sh
  19. $ go get gopkg.in/ini.v1
  20. ```
  21. Please add `-u` flag to update in the future.
  22. ## Go Modules
  23. For historical reason, people use two different import paths for this package: `github.com/go-ini/ini` and `gopkg.in/ini.v1`. If you get error similar to the following one:
  24. ```
  25. go: finding github.com/go-ini/ini v0.0.0-00010101000000-000000000000
  26. go: github.com/go-ini/ini@v0.0.0-00010101000000-000000000000: unknown revision 000000000000
  27. go: error loading module requirements
  28. ```
  29. It is because one of your dependencies is using deprecated import path `github.com/go-ini/ini`, you can make a quick fix by adding the following line to your `go.mod` file (`v.1.44.0` was the latest version tagged on `master` branch):
  30. ```
  31. replace github.com/go-ini/ini => gopkg.in/ini.v1 v1.44.0
  32. ```
  33. ## Getting Help
  34. - [Getting Started](https://ini.unknwon.io/docs/intro/getting_started)
  35. - [API Documentation](https://gowalker.org/gopkg.in/ini.v1)
  36. ## License
  37. This project is under Apache v2 License. See the [LICENSE](LICENSE) file for the full license text.