Skip to content

go.mod: regression: go mod init cannot create module with some unicode charcters if package path is provided on the command line #33698

Closed
@SamWhited

Description

@SamWhited

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

$ go version
go version devel +c485506b0aae 20190816195457 linux/amd64

Does this issue reproduce with the latest release?

No (1.12.9 works as expected)

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

go env Output
$ go env
GO111MODULE="on"
GOARCH="amd64"
GOBIN="/home/sam/bin"
GOCACHE="/home/sam/.cache/go-build"
GOENV="/home/sam/.config/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GONOPROXY="*"
GONOSUMDB="*"
GOOS="linux"
GOPATH="/home/sam/go"
GOPRIVATE="*"
GOPROXY="127.0.0.1"
GOROOT="/home/sam/Projects/go"
GOSUMDB="off"
GOTMPDIR=""
GOTOOLDIR="/home/sam/Projects/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/home/sam/go/src/mellium.im/communiqué-shiny/go.mod"
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-build510054645=/tmp/go-build -gno-record-gcc-switches"

What did you do?

$ cd $GOPATH
$ mkdir -p mellium.im/communiqué
$ cd mellium.im/communiqué
$ # This works
$ go mod init
go: creating new go.mod: module mellium.im/communiqué
$ cat go.mod 
module mellium.im/communiqué

go 1.13
$ rm go.mod

$ # This does not work
$ go mod init mellium.im/communiqué
go: malformed import path "mellium.im/communiqué": invalid char 'é'
$ go1.12.9 mod init mellium.im/communiqué
go: creating new go.mod: module mellium.im/communiqué

What did you expect to see?

Running go mod init and go mod init mellium.im/communiqué should both produce a valid go.mod file with some form of Unicode normalization applied.

What did you see instead?

They both behave the same in Go 1.12.9, but do not behave the same in Go 1.13.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions