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

[BUG] The filename, directory name, or volume label syntax is incorrect. #12

Open
keiqiu opened this issue Jan 13, 2021 · 3 comments
Open

Comments

@keiqiu
Copy link

keiqiu commented Jan 13, 2021

in windows 10 system:
workdir: d://work_golang
git clone https://github.com/micro/services.git

micro run services/helloworld
mkdir C:\Users\user\AppData\Local\Temp\micro\uploads\helloworld\D:: The filename, directory name, or volume label syntax is incorrect.

when i change the code runtime/default.go:133

target = filepath.Join(dst, header.Name)
// if no join is needed, replace with ToSlash:
// target = filepath.ToSlash(header.Name)

to

target = filepath.Join(dst, header.Name)
// if no join is needed, replace with ToSlash:
target = filepath.ToSlash(header.Name)

it will be ok

Environment:

$ go version
go version go1.14.13 windows/amd64

$ go env
set GO111MODULE=on
set GOARCH=amd64
set GOBIN=C:\go\bin
set GOCACHE=C:\Users\user\AppData\Local\go-build
set GOENV=C:\Users\user\AppData\Roaming\go\env
set GOEXE=.exe
set GOFLAGS=
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GOINSECURE=
set GONOPROXY=
set GONOSUMDB=
set GOOS=windows
set GOPATH=D:\go
set GOPRIVATE=
set GOPROXY=https://goproxy.io
set GOROOT=C:\go
set GOSUMDB=sum.golang.org
set GOTMPDIR=
set GOTOOLDIR=C:\go\pkg\tool\windows_amd64
set GCCGO=gccgo
set AR=ar
set CC=gcc
set CXX=g++
set CGO_ENABLED=1
set GOMOD=NUL
set CGO_CFLAGS=-g -O2
set CGO_CPPFLAGS=
set CGO_CXXFLAGS=-g -O2
set CGO_FFLAGS=-g -O2
set CGO_LDFLAGS=-g -O2
set PKG_CONFIG=pkg-config
set GOGCCFLAGS=-m64 -mthreads -fmessage-length=0 -fdebug-prefix-map=C:\Users\user\AppData\Local\Temp\go-build000353338=/tmp/go-build -gno-record-gcc-switches


@keiqiu
Copy link
Author

keiqiu commented Jan 13, 2021

package main

import (
	"log"
	"os"
	"path/filepath"
)

func main()  {
	dst, to := "D:\\work_golang", "D:\\test"

	target := filepath.Join(dst, to)

	log.Println(target)

	if err := os.MkdirAll(target, 0755); err != nil {
		log.Println(err.Error())
	}
}
$ go run test.go
2021/01/13 15:12:00 D:\work_golang\D:\test
2021/01/13 15:12:00 mkdir D:\work_golang\D:: The filename, directory name, or volume label syntax is incorrect.

@chriswenwu
Copy link

这个问题现在官方还没解决吗? 现在运行还报这个错误。

@Guohuixixi
Copy link

在windows上修改了default.go那两行后还是会报错,linux上直接上运行就可以了

alex-dna-tech added a commit to alex-dna-tech/cli that referenced this issue Mar 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants