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

cmd/go: malformed import path "example.com/vers/β": invalid char 'β' #44842

Closed
martin-flower opened this issue Mar 7, 2021 · 3 comments
Closed

Comments

@martin-flower
Copy link

go version go1.16 darwin/arm64

issue reproduced with latest release

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

go env Output
GO111MODULE=""
GOARCH="arm64"
GOBIN=""
GOCACHE="/Users/martin/Library/Caches/go-build"
GOENV="/Users/martin/Library/Application Support/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="arm64"
GOHOSTOS="darwin"
GOINSECURE=""
GOMODCACHE="/Users/martin/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="darwin"
GOPATH="/Users/martin/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/local/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/darwin_arm64"
GOVCS=""
GOVERSION="go1.16"
GCCGO="gccgo"
AR="ar"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD="/Users/martin/temp/vers/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 -arch arm64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/7m/0mprszbx57zc2td3x0kj3l580000gn/T/go-build706797998=/tmp/go-build -gno-record-gcc-switches -fno-common"

What did you do?

package main
import (
	"fmt"
	"example.com/vers/β"
)

func main() {
	fmt.Println("Hello, World!")
	fmt.Printf("Somewhere β:%s", β.Somewhere())
}

What did you expect to see?

expected to compile correctly

What did you see instead?

malformed import path "example.com/vers/β": invalid char 'β'

@martin-flower
Copy link
Author

Compiles and executes correctly on

go version go1.15.8 darwin/amd64

@odeke-em
Copy link
Member

odeke-em commented Mar 7, 2021

Thank you for this report @martin-flower and welcome to the Go project!

So in #43052, we made cmd/go deliberately reject module paths that were non-ASCII and particularly added a release note for Go1.16 in https://golang.org/doc/go1.16#go-command per
C6858E99-2D85-433C-B01A-074D6E758CBA

@maruel reported this same issue in #43035 but more intentionally a regression that the team fixed for Go1.16.
Kindly cc-ing @bcmills, @jayconrod, @matloob, but I don’t think there is anything that we can do here.

@odeke-em odeke-em changed the title malformed import path "example.com/vers/β": invalid char 'β' cmd/go: malformed import path "example.com/vers/β": invalid char 'β' Mar 7, 2021
@odeke-em odeke-em closed this as completed Mar 7, 2021
@kostich
Copy link

kostich commented Mar 27, 2021

Is there a workaround for users who have packages named with non-ASCII characters? Like, some kind of punny-code?

@golang golang locked and limited conversation to collaborators Mar 27, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants