go install command is failing because go.mod contains replace directives.
The replace directive should only be used during development.
It should be deleted for releases.
$ docker run -it --rm golang:1.18
root@8a297095e57f:/go# go install github.com/named-data/YaNFD/cmd/yanfd@latest
go: downloading github.com/named-data/YaNFD v1.1.0
go: github.com/named-data/YaNFD/cmd/yanfd@latest (in github.com/named-data/YaNFD@v1.1.0):
The go.mod file for the module providing named packages contains one or
more replace directives. It must not contain directives that would cause
it to be interpreted differently than if it were the main module.
root@8a297095e57f:/go# go install github.com/named-data/YaNFD/cmd/yanfd@master
go: downloading github.com/named-data/YaNFD v1.1.1-0.20220427100501-fcce5a0a157d
go: github.com/named-data/YaNFD/cmd/yanfd@master (in github.com/named-data/YaNFD@v1.1.1-0.20220427100501-fcce5a0a157d):
The go.mod file for the module providing named packages contains one or
more replace directives. It must not contain directives that would cause
it to be interpreted differently than if it were the main module.
go install
command is failing becausego.mod
containsreplace
directives. Thereplace
directive should only be used during development. It should be deleted for releases.