美文网首页
golang build时遇到expected 'STRING'

golang build时遇到expected 'STRING'

作者: 北二条 | 来源:发表于2020-06-15 12:15 被阅读0次

    如标题,遇到此问题:

    $ go run pdfeditor.go
    ..\..\sirupsen\logrus\terminal_check_windows.go:9:2:
    ..\..\..\golang.org\x\sys\windows\syscall_test.go:10:1: expected 'STRING', found '<<'
    ..\..\..\golang.org\x\sys\windows\syscall_test.go:22:2: expected 'STRING', found 'if'
    ..\..\..\golang.org\x\sys\windows\syscall_test.go:26:2: expected 'STRING', found 'if'
    ..\..\..\golang.org\x\sys\windows\syscall_test.go:29:2: expected 'STRING', found 'if'
    ..\..\..\golang.org\x\sys\windows\syscall_test.go:45:2: expected 'STRING', found 'if'
    ..\..\..\golang.org\x\sys\windows\syscall_test.go:49:2: expected 'STRING', found 'if'
    ..\..\..\golang.org\x\sys\windows\syscall_test.go:52:2: expected 'STRING', found 'const'
    ..\..\..\golang.org\x\sys\windows\syscall_test.go:54:2: expected 'STRING', found 'if'
    ..\..\..\golang.org\x\sys\windows\syscall_test.go:63:2: expected 'STRING', found 'if'
    ..\..\..\golang.org\x\sys\windows\syscall_test.go:66:2: expected 'STRING', found 'if'
    ..\..\..\golang.org\x\sys\windows\syscall_test.go:70:50: expected ')', found 'EOF'
    

    貌似是相应组件在windows上已经损坏了,我删除掉golang.org/x/,重新go get -u 挨个恢复就好了,go get 需要代理。

    drwxr-xr-x 1 Administrator 197121         0 六月 15 09:31 crypto/
    drwxr-xr-x 1 Administrator 197121         0 六月 15 09:31 exp/
    drwxr-xr-x 1 Administrator 197121         0 六月 15 09:31 image/
    drwxr-xr-x 1 Administrator 197121         0 六月 15 09:31 lint/
    drwxr-xr-x 1 Administrator 197121         0 六月 15 09:31 mobile/
    drwxr-xr-x 1 Administrator 197121         0 六月 15 09:31 net/
    drwxr-xr-x 1 Administrator 197121         0 六月 15 09:31 oauth2/
    drwxr-xr-x 1 Administrator 197121         0 六月 15 09:31 sys/
    drwxr-xr-x 1 Administrator 197121         0 六月 15 09:31 text/
    drwxr-xr-x 1 Administrator 197121         0 六月 15 09:31 time/
    drwxr-xr-x 1 Administrator 197121         0 六月 15 09:31 tools/
    

    相关文章

      网友评论

          本文标题:golang build时遇到expected 'STRING'

          本文链接:https://www.haomeiwen.com/subject/unhcxktx.html