编写第一个驱动程序_编写您的第一个程序

编写第一个驱动程序

什么是去? (What is Go?)

Go is programming language introduced by Google at 2009. It’s syntactically similar to C but with memory safety and garbage collection.

Go是Google在2009年推出的编程语言。从语法上讲,它类似于C,但是具有内存安全性和垃圾回收功能。

为什么要学习围棋? (Why learn Go?)

Go is a very modern programming language (unlike python that is introduced at 1990) that deals with modern computers and problems. It’s a small language containing only 25 keywords. The inventors of Go didn’t blindly follow the typical ideas of computer languages. Go is a very easy and clean to write and read.

Go是一种非常现代的编程语言(不同于1990年引入的python),它处理现代计算机和问题。 这是一种仅包含25个关键字的小语言。 Go的发明者并没有盲目地遵循计算机语言的典型思想。 围棋是一件很容易的和干净的写入读取。

在Windows上安装Go (Install Go on Windows)

  1. Download and Install the Microsoft Windows file from this link.

    下载并安装由微软Windows文件这个链接。

  2. Download and Install VS Code (Editor).

    下载并安装VS Code(编辑器)。
  3. That’s all. We are ready to work

    就这样。 我们准备工作

在Go中打印“ Hello World” (Print “Hello World” in Go)

Fire up your VS Code and create a new file main.go (.go is the Go file’s extension). Write the following lines of codes in the main.go file.

启动你的VS代码,并创建一个新的文件main.go(。是去文件的扩展名)。 将以下代码行写入main.go文件中。

package main
import "fmt"func main() {
fmt.Println("hello world")
}

Now open the VS Code’s terminal by pressing ctrl+~ . You will see something like this:

现在,按ctrl +〜打开VS Code的终端 。 您 会看到这样的东西:

Image for post

Write the following line in the terminal to run the main.go file

在终端中编写以下行以运行main.go文件

go run main.go

If everything is okay, the output will look like this:

如果一切正常,输出将如下所示:

Image for post

Hurrah! You have written your first code in Go.

欢呼! 您已经在Go中编写了第一个代码。

I will come with more posts on Go Programming in future.

将来,我将提供更多有关Go编程的文章。

Peace !!

和平!

  1. https://gophercoders.com/why-learn-go/

    https://gophercoders.com/why-learn-go/

  2. https://en.wikipedia.org/wiki/Go_(programming_language)

    https://zh.wikipedia.org/wiki/Go_(programming_language)

翻译自: https://medium.com/@md.alifbiswas/write-your-first-program-in-go-a55b84898a13

编写第一个驱动程序

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值