A collection of small helpers around Go proxy, Go meta information, etc.
A small Go proxy client to get information about a module from a Go proxy.
Example
package main
import (
"fmt"
"github.com/ldez/grignotin/goproxy"
)
func main() {
client := goproxy.NewClient("")
versions, err := client.GetVersions("github.com/ldez/grignotin")
if err != nil {
panic(err)
}
fmt.Println(versions)
}
A small lib to fetch meta information (go-import
, go-source
) for a module.
Example
package main
import (
"fmt"
"github.com/ldez/grignotin/metago"
)
func main() {
meta, err := metago.Get("github.com/ldez/grignotin")
if err != nil {
panic(err)
}
fmt.Println(meta)
}
Gets information about releases and build.
Examples
package main
import (
"fmt"
"github.com/ldez/grignotin/version"
)
func main() {
includeAll := false
releases, err := version.GetReleases(includeAll)
if err != nil {
panic(err)
}
fmt.Println(releases)
}
package main
import (
"fmt"
"github.com/ldez/grignotin/version"
)
func main() {
build, err := version.GetBuild()
if err != nil {
panic(err)
}
fmt.Println(build)
}
- I recommend using the package sumdb
A set of functions to get information about module (go list
/go env
).
Examples
package main
import (
"fmt"
"github.com/ldez/grignotin/gomod"
)
func main() {
info, err := gomod.GetModuleInfo()
if err != nil {
panic(err)
}
fmt.Println(info)
}
package main
import (
"fmt"
"github.com/ldez/grignotin/gomod"
)
func main() {
modpath, err := gomod.GetModulePath()
if err != nil {
panic(err)
}
fmt.Println(modpath)
}
A set of functions to get information from go env
.
Examples
package main
import (
"fmt"
"github.com/ldez/grignotin/goenv"
)
func main() {
value, err := goenv.GetOne(goenv.GOMOD)
if err != nil {
panic(err)
}
fmt.Println(value)
}
package main
import (
"fmt"
"github.com/ldez/grignotin/goenv"
)
func main() {
values, err := goenv.Get(goenv.GOMOD, goenv.GOMODCACHE)
if err != nil {
panic(err)
}
fmt.Println(values)
}
package main
import (
"fmt"
"github.com/ldez/grignotin/goenv"
)
func main() {
values, err := goenv.GetAll()
if err != nil {
panic(err)
}
fmt.Println(values)
}