我是一个完整的初学者。而我刚刚安装了gophernotes,打算主要使用Jupyter Notebook进行编程。
该程序在 Jupyter 中运行时出现以下错误:
Cell1: package main
Out1: runtime error: index out of range
Cell2: import "fmt"
func main() {
fmt.Println("hello world")
}
main()
Out2: hello world
当我在 a 中编写相同内容test.go并从 bash: 执行时go run test.go,我得到以下信息:
Deepaks-MacBook-Air:JUPYTER deepak$ go run test.go
go: disabling cache (/Users/deepak/Library/Caches/go-build) due to initialization failure: open /Users/deepak/Library/Caches/go-build/log.txt: permission denied
# command-line-arguments
./test.go:6:1: syntax error: non-declaration statement outside function body
holdtom
相关分类