Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/edwin-luijten/go_mod_parser
Parse go.mod files into structs, this module is extracted from https://github.com/golang/vgo/tree/master/vendor/cmd/go/internal/modfile
https://github.com/edwin-luijten/go_mod_parser
Last synced: 1 day ago
JSON representation
Parse go.mod files into structs, this module is extracted from https://github.com/golang/vgo/tree/master/vendor/cmd/go/internal/modfile
- Host: GitHub
- URL: https://github.com/edwin-luijten/go_mod_parser
- Owner: Edwin-Luijten
- Created: 2019-03-06T13:11:18.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2019-03-07T06:56:52.000Z (almost 6 years ago)
- Last Synced: 2024-11-18T05:57:55.564Z (2 months ago)
- Language: Go
- Size: 21.5 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# GO mod parser
This module is extracted from https://github.com/golang/vgo/tree/master/vendor/cmd/go/internal/modfile
## Installation
``` go get github.com/edwin-luijten/go_mod_parser ```## Usage
```go
package my_packageimport (
"github.com/edwin-luijten/go_mod_parser"
"io/ioutil"
"fmt"
)func main() {
contents, _ := ioutil.ReadFile("./go.mod")
p, err := go_mod_parser.Parse("go.mod", contents, nil)
if err != nil {
panic(err)
}
fmt.Println(p.Module.Mod.Path)
}
```