Skip to content

x/text/cmd/gotext: generated files keep changing when there is no code change #33552

@linggao

Description

@linggao

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

$ go version
1.11.4 linux/amd64

Does this issue reproduce with the latest release?

yes

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

go env Output
$ go env
GOARCH="amd64"
GOBIN=""
GOCACHE="/root/.cache/go-build"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/go"
GOPROXY=""
GORACE=""
GOROOT="/usr/local/go"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
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-build093772979=/tmp/go-build -gno-record-gcc-switches"

What did you do?

Run gotext to create a message catalog.
gotext -srclang=en update -out=catalog/catalog.go -lang=en,el

What did you expect to see?

catalog/catalog.go should stay the same if nothing is changed.
locales/en/out.gotext.json and locales/el/out.gotext.json files stays the same if no code has been changed.

What did you see instead?

Index value for a string in the messageKeyToIndex in catalog/catalog.go keeps changing every time gotext is run with the same code. This makes development process hard when there are multiple developers and when this files is checked in a repository. We hope that if there are no message changes, this file stays the same.
locales/en/out.gotext.json and locales/el/out.gotext.json files also changed a lot when there is no code changes.

Metadata

Metadata

Assignees

No one assigned

    Labels

    FrozenDueToAgeNeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions