Go语言之 go tool compoile问题

Gool tool compoile

今天使用win10环境安装了go语言编辑环境,然后cmd运行入门demo报错。

代码:

package main

import "fmt"

func main(){
    fmt.Println("Hello, World")
}

cmd运行命令:

go run test.go

报错:

go tool compile: open NUL: The system cannot find the file specified.

重装了go环境也没有用,最后确定是win10 系统的问题,在win10设置之安全更新,把win10更新到最新版本即可。

Go语言之 go tool compoile问题

最终更新完毕win10:

Go语言之 go tool compoile问题

重新go run test.go,问题解决:
Go语言之 go tool compoile问题