go WARNING

WARNING For the code in this section, you should install my prettyslice library. STEPS Open your command-line Type: go get -u github.com/inancgumus/prettyslice That's all.
阅读全文

go Slice Exercises

Slice Exercises Exercises Level I - Basics — Warm-Up Let's reinforce your basic knowledge of slices. Declare nil slices Assign empty slices Assign slice literals Declare the arrays as slices Fix the P
阅读全文

go 01-packages-A

属于同一个包的源代码存储在哪里? 每个文件应该存储在不同的目录 在同一个目录下 正确 为什么 Go 源代码需要使用 package 语句? 用来导入包 用来让 Go
阅读全文

go 03-scopes

作用域是什么? 可执行的代码块 声明变量的可见性 正确 确定要运行的内容 package awesome import "fmt" var enabled bool func block() { var counter int fmt.Println(counter) } 哪个变量属于包作用域
阅读全文

go 02-packages-B

下面哪一个是 Go 中正确的软件包类型? Empty package Executable package 正确 Transferrable package Librarian package 下面哪一个 package go run 可以执行? Empty package Executable
阅读全文

go 练习

使用自己定义的包 创建几个 Go 文件,并在 main 函数里调用它们里面的函数 作用域的初体验 了解跨包作用域的效果 imports 重命名 使用不同的名字导入同一个包
阅读全文

go 打印

打印 Print Your Age Print Your Name and LastName False Claims Print the Temperature Double Quotes Print the Type Print the Type #2 Print the Type #3 Print the Type #4 Print Your Fullname
阅读全文

go 01-gopath

应该保存 Go 源代码到哪里? 我的电脑任何地方 $GOPATH 下 $GOPATH/src 下 正确 $GOPATH 是什么? 它是 Go 运行时的文件 存储 Go 源代码文件和编译的包的目录 它是
阅读全文

go 02-code-your-first-program

下面哪一个关键字用来定义一个包? package main func main() { } func package 正确 fmt.Println import 1: func 关键字用来新定义一个函数 2: 对,package 关键字用来在 Go 文件中定义包
阅读全文

go 03-run-your-first-program

go build 和 go run 有什么区别? go run 只编译程序; 而 go build 编译运行程序 go run 编译运行程序; whereas go build 只编译程序。 正确 1: 实际上相反的 2: go run 编译程序并把它放在一个临时目录下,然后在临时目录里运行整个程序
阅读全文