Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

x/text: dir flag in gotext is useless #28097

Open
toby3d opened this issue Oct 9, 2018 · 2 comments
Open

x/text: dir flag in gotext is useless #28097

toby3d opened this issue Oct 9, 2018 · 2 comments
Milestone

Comments

@toby3d
Copy link

@toby3d toby3d commented Oct 9, 2018

What version of Go are you using (go version)?

go version go1.13.5 linux/amd64

Does this issue reproduce with the latest release?

Yes

What operating system and processor architecture are you using (go env)?

GO111MODULE=""
GOARCH="amd64"
GOBIN="/home/toby3d/go/bin"
GOCACHE="/home/toby3d/.cache/go-build"
GOENV="/home/toby3d/.config/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/home/toby3d/go"
GOPRIVATE="github.com/toby3d"
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/lib/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/lib/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD=""
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build372653986=/tmp/go-build -gno-record-gcc-switches"

What did you do?

I try generate locales strings in other folder.

go:generate tag contains in /cmd/myapp/main.go and I use flag -dir=./../../ for generating locales string in root of project directory /locales/...:

//go:generate gotext -dir=./../../ -srclang=en update -out=locales_gen.go -lang=en,ru
package main
...

What did you expect to see?

gotext use -dir flag and generate locales strings on specific path (for my case - in project root directory).

What did you see instead?

gotext creates folder with strings in main.go directory: /cmd/myapp/locales/....

Seems like what -dir flag just not used (deadcode):
https://github.com/golang/text/blob/905a57155faa8230500121607930ebb9dd8e139c/cmd/gotext/main.go#L40

@gopherbot gopherbot added this to the Unreleased milestone Oct 9, 2018
@agnivade

This comment has been minimized.

Copy link
Contributor

@agnivade agnivade commented Nov 11, 2019

@toby3d

This comment has been minimized.

Copy link
Author

@toby3d toby3d commented Dec 24, 2019

Still reproduced. In addition, the tool cannot be used if the module system is enabled.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.