当前位置:网站首页>Go 语法 变量
Go 语法 变量
2022-06-12 03:03:00 【AntHub】
简介
- go的一个思想:一个问题尽量只有一个解决方案是最好的。
- go 中函数是第一等元素。
- studygolang.com/pkgdoc
go build src.go # 编译
go run src.go # 编译并运行,不生成exe可执行文件
gofmt -w src.go # -w 写入源文件,否则会在标准输出/控制台显示格式化后的代码
一些语法
- 严格区分大小写;
- 语句不需要分号;
- 编译器是一行一行编译的,因此一行就写一条语句,多个语句卸载同一行会报错;
- 定时的变量或者 导入的包没有使用到,编译不能通过;
- 全局变量声明后不使用可以编译通过;
- 全局变量不能用
:=赋值
go 数据类型
基本数据类型
- 数值型:2类,整数类型
边栏推荐
- Start stop script and distribution script of shell
- Intel Galileo Gen2 development
- Min25 sieve
- 推荐6款办公软件,好用还免费,效率翻倍
- Function templatesfunction templates
- Sparse tensor based point cloud attribute compression
- AcrelCloud-6000安全用电云平台在某商业广场的应用
- Selection (044) - what is the output of the following code?
- min25筛
- Bochuang smart sprint technology innovation board: annual revenue of RMB 1.1 billion, book value of accounts receivable of RMB 300million
猜你喜欢

微信小程序项目实例——体质计算器

errno: -4078, code: ‘ECONNREFUSED‘, syscall: ‘connect‘, address: ‘127.0.0.1‘, port: 3306; Postman error

无限循环判断方法;

WPS表格 学习笔记 - 高亮显示重复值

One article to show you how to understand the harmonyos application on the shelves

Comparaison de la taille des fractions

AcrelCloud-6000安全用电云平台在某商业广场的应用

Cupp dictionary generation tool (similar tools include crunch)

Introduction to program environment and preprocessing C language (advanced level)

WPS table learning notes - highlight duplicate values
随机推荐
How to reduce the complexity of cloud computing infrastructure?
A single quarter of educational technology revenue of 230million: a year-on-year decrease of 51% and a sharp narrowing of net loss
Demand and business model innovation - demand 6- stakeholder analysis and hard sampling
Research Report on Chinese psoriasis drug market evaluation and investment direction (2022 Edition)
Infinite loop judgment method;
[digital signal processing] correlation function (energy signal | cross correlation function of energy signal | autocorrelation function of energy signal)
I2C协议概述
The unique path of leetcode topic resolution II
博创智能冲刺科创板:年营收11亿 应收账款账面价值3亿
xml
I2C protocol overview
Paper recommendation: relicv2, can the new self supervised learning surpass supervised learning on RESNET?
Maya Front Office Rendering plug - in Mel script Tool
Maya foreground rendering plug-in Mel scripting tool
maya前臺渲染插件mel脚本工具
JSON and XML pros and cons
小红的删数字
Exemple de projet d'applet Wechat - calculatrice de constitution
推荐6款办公软件,好用还免费,效率翻倍
Recommend 6 office software, easy to use and free, double the efficiency