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/cmd/gotext: dir flag in gotext is useless #28097

Closed
toby3d opened this issue Oct 9, 2018 · 4 comments
Closed

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

toby3d opened this issue Oct 9, 2018 · 4 comments
Labels
NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone

Comments

@toby3d
Copy link

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
Copy link
Contributor

@mpvl

@toby3d
Copy link
Author

toby3d commented Dec 24, 2019

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

@toby3d
Copy link
Author

toby3d commented Aug 3, 2021

Any updates?

@seankhliao seankhliao changed the title x/text: dir flag in gotext is useless x/text/cmd/gotext: dir flag in gotext is useless Jun 5, 2022
@seankhliao seankhliao added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Aug 20, 2022
@seankhliao
Copy link
Member

Duplicate of #61507

@seankhliao seankhliao marked this as a duplicate of #61507 Jul 21, 2023
@seankhliao seankhliao closed this as not planned Won't fix, can't repro, duplicate, stale Jul 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Projects
None yet
Development

No branches or pull requests

4 participants