An open API service indexing awesome lists of open source software.

https://github.com/mxk/go-gomod

Go package for obtaining compiled module information at run time
https://github.com/mxk/go-gomod

go golang

Last synced: 3 months ago
JSON representation

Go package for obtaining compiled module information at run time

Awesome Lists containing this project

README

        

gomod
=====

[![GoDoc](https://godoc.org/github.com/mxk/go-gomod?status.svg)](https://godoc.org/github.com/mxk/go-gomod)
[![Report card](https://goreportcard.com/badge/github.com/mxk/go-gomod)](https://goreportcard.com/report/github.com/mxk/go-gomod)

Package gomod provides information about modules compiled into the binary.

```
go get github.com/mxk/go-gomod
```

The implementation requires access to `runtime` package internals via `unsafe`
to locate the file table and parse module information from compiled file paths.
Module names extracted from file paths may not match actual package names.