4、Go语言基础之输出方式【知识点补充】 fmt 包实现了格式化 I/O 函数,类似于 C 的 printf 和 scanf,格式“占位符”衍生自 C,但比 C 更简单 1、输出方式的区别 Print、Println 、Printf、Sprintf 、Fprintf都是fmt 包中的公共方法,在需要 ...
分类:
编程语言 时间:
2020-06-07 21:02:45
阅读次数:
61
示例数据库 CREATE DATABASE Study GO USE Study CREATE TABLE student ( s_id char(6) NOT NULL, name varchar(10) NOT NULL, dept varchar(15) NULL, gpa float NUL ...
分类:
其他好文 时间:
2020-06-07 17:59:30
阅读次数:
46
CASE WHEN THEN随手练,就当做练习指法吧 --drop table tbStudent GO Create table tbStudent( studentId int identity(1,1), fSex varchar(12), fProvince varchar(32) ) GO ...
分类:
其他好文 时间:
2020-06-07 15:03:12
阅读次数:
59
2、Go语言基础之数据类型 Go语言中有丰富的数据类型,除了基本的整型、浮点型、布尔型、字符串外,还有数组、切片、结构体、函数、map、通道(channel)等。 基本数据类型 1.1整型 整型分为以下两个大类: 按长度分为:int8、int16、int32、int64 对应的无符号整型:uint8 ...
分类:
编程语言 时间:
2020-06-07 14:44:13
阅读次数:
68
一,grafana的用途 1,grafana是什么? grafana 是用 go 语言编写的开源应用, 它的主要用途是大规模指标数据的可视化展现 它是现在网络架构/应用分析中最流行的时序数据展示工具 2,如何安装prometheus? 参见这一篇: https://www.cnblogs.com/a ...
分类:
系统相关 时间:
2020-06-07 12:30:53
阅读次数:
201
package main import ( "time" "fmt" "runtime" ) func test() { for i:=0;i<10;i++{ time.Sleep(time.Microsecond *100) fmt.Print(i) } fmt.Println(" ") } fu ...
分类:
其他好文 时间:
2020-06-07 11:06:47
阅读次数:
59
package main import "fmt" type Dog struct { Name string } func TestStruct() { // 方式1 //var dog Dog //dog.Name = "jj" // 方式2 //dog := Dog{Name:"wang"} ...
分类:
其他好文 时间:
2020-06-06 23:27:52
阅读次数:
94
panic 抛出异常 通过recover捕获 类似 php python等语言的try catch package mainimport ( "fmt" "errors")func main() { testPanic()}func testPanic() { defer coverPanic() ...
分类:
其他好文 时间:
2020-06-06 21:58:46
阅读次数:
84
package main import "fmt" func main() { // make函数 makeSlice() // 创建切片 makeMap() // 创建集合 makeChan() // 创建channel } func makeSlice(){ sl := make([]strin ...
分类:
其他好文 时间:
2020-06-06 20:08:38
阅读次数:
224
package main import ( "time" "fmt" ) func main() { c := make(chan string) go func() { time.Sleep(1 * time.Second) c <- "hello from chan" // 数据发送到chann ...
分类:
其他好文 时间:
2020-06-06 18:45:24
阅读次数:
51