Invalid import path - Go + windows -


when attempting import files windows file system:

import (     pb "github.com\\sewelol\\sgx-decryption-service\\decryptionservice"     dev "github.com\\sewelol\\sgx-decryption-service\\device"     "google.golang.org\\rpc"` ) 

i error

server\main.go:10:5: invalid import path: "github.com\\sewelol\\sgx-decryption-service\\decryptionservice"

i have checked $path enviroment variable includes directory has github.com, , $goroot set point go installation.

i assume file paths themselves, can't find information on how filepaths in windows environment.

thanks

you have use forward slashes / in import paths (of import declarations), if you're on windows.

spec: import declarations:

implementation restriction: compiler may restrict importpaths non-empty strings using characters belonging unicode's l, m, n, p, , s general categories (the graphic characters without spaces) , may exclude characters !"#$%&'()*,:;<=>?[\]^{|}` , unicode replacement character u+fffd.

any compiler may exclude backslash \ character among others. if use 1 doesn't, code not portable.

so instead try:

import (     pb "github.com/sewelol/sgx-decryption-service/decryptionservice"     dev "github.com/sewelol/sgx-decryption-service/device"     "google.golang.org/rpc" ) 

Comments

Popular posts from this blog

python - Selenium remoteWebDriver (& SauceLabs) Firefox moseMoveTo action exception -

html - How to custom Bootstrap grid height? -

transpose - Maple isnt executing function but prints function term -