https://github.com/mrueg/go-deconstruct
Takes a non-stripped go binary that is built with go module support and creates a go.mod from it.
https://github.com/mrueg/go-deconstruct
go golang gomodule gomodules
Last synced: about 1 year ago
JSON representation
Takes a non-stripped go binary that is built with go module support and creates a go.mod from it.
- Host: GitHub
- URL: https://github.com/mrueg/go-deconstruct
- Owner: mrueg
- License: apache-2.0
- Created: 2020-01-14T12:10:56.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2022-03-14T11:00:17.000Z (about 4 years ago)
- Last Synced: 2025-02-01T03:42:10.747Z (over 1 year ago)
- Topics: go, golang, gomodule, gomodules
- Language: Go
- Homepage:
- Size: 48.8 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# go-deconstruct
Takes a non-stripped go binary that is built with go module support and creates a go.mod from it.
## Usage
```
./go-deconstruct generate ${BINARY} [-o /path/to/go.mod]
```
## Example
```
./go-deconstruct generate ./go-deconstruct
```
Returns:
```
module github.com/mrueg/go-deconstruct
go 1.17
require (
github.com/rsc/goversion v1.2.0
github.com/spf13/cobra v1.4.0
github.com/spf13/pflag v1.0.5
)
```
## Caveats
* Does not work on go binaries built without module support
* Does not work on stripped binaries
* Does include additional dependencies, that are dependencies from other dependencies (e.g. spf13/cobra depends on spf13/pflag)
* Does not include exclude directives (as they are not included in the go binary)