Go编程基础
Go的内置keyword(25个) 不多
break default func interface select
case defer go map struct
chan else goto package switch
const fallthrough if range type
continute for import return var
Go的凝视方法(和js一样)
单行凝视: //
多行凝视: /**/
Go程序一般结构 common_structure.go
- 通过 package 组织代码结构(类似python的模块)
- 仅仅有 package 名称为 main 的包能够包括 main 函数
- 一个可运行程序 有且仅有一个 main 包
- 通过 import 来导入包
- const 用来定义常量(类似c)
- 函数体外部使用 var 来进行全局变量的声明和赋值
- 复杂类型 struct , interface 要用 type keyword来声明
- func 来声明函数
简单的demo
/*
title: common_structure.go
author: orangleliu
date: 2014-08-05
des: the simple demo of erlang
*/
// a package only have a main
package main
// use “import” import other packages
import “fmt”
const Lzz = “Orangleliu”
var name = “erlong”
type age int
type golang struct{
}
func main(){
fmt.Println(“I love Erlog!”)
}
Linux文件系统的实现
门外汉的IT
被解放的姜戈05 黑面管家
被解放的姜戈04 各取所需
被解放的姜戈03 所谓伊人
统计Go, Go, Go
被解放的姜戈02 庄园疑云
被解放的姜戈01 初试天涯
亚马逊云架设WordPress博客
- 最新文章
-
1、体脂手环、体脂秤等产品的体脂测量原理及技术方案分析
Linux环境下启动、停止、重启nginx
linux安装mysql
./bin/mysqld: error while loading shared libraries: libaio.so.1: cannot open shared object file:
Mysql设置远程连接
Mysql修改用户密码报错ERROR 1054 (42S22): Unknown Column 'Password' In 'Field List'解决办法
systemctl设置Redis启动、停止、开机启动
Java 怎么获取 Iterable 大小(个数)
java.lang.ArithmeticException: Non-terminating decimal expansion; no exact representable decimal result
计算程序运行时间