mozillazg / go-unidecode

ASCII transliterations of Unicode text.
https://godoc.org/github.com/mozillazg/go-unidecode
MIT License
130 stars 19 forks source link

CLI tool does not install with documented command #11

Closed sybrenstuvel closed 1 year ago

sybrenstuvel commented 1 year ago

This command from the README:

$ go get -u github.com/mozillazg/go-unidecode/unidecode

does not install the executable in $GOPATH/bin. The behaviour of go get changed in 2021 (Go 1.17). For more info on this, see Deprecation of 'go get' for installing executables.

For this a go install command is required, but a naieve attempt also fails:

$ go install github.com/mozillazg/go-unidecode/unidecode@latest
go: github.com/mozillazg/go-unidecode/unidecode@latest (in github.com/mozillazg/go-unidecode/unidecode@v0.0.0-20220820075503-98ea07f60ab0):
        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.

It is this replacement rule that's causing this error:

replace github.com/mozillazg/go-unidecode => ../
mozillazg commented 1 year ago

@sybrenstuvel Thanks for reporting. Feel free to send a pull request to fix this issue.