Go/

directory
v0.0.0-...-0bfea92 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 20, 2023 License: MIT

README

Go Land

Run

  go run xxx.go
  go build xxx.go

Link

  1. Go语言入门教程

数据类型

  1. Boolean
  2. 数字类型 string int / float32 / float64
    • 整数
    • 浮点数
    • 复数
  3. 字符串
  4. 派生类型
    • 指针类型(Pointer)
    • 数组类型
    • 结构化类型
    • Channel 类型
    • 函数类型
    • 切片类型
    • 接口类型(interface)
    • Map 类型

笔记

  1. iota 常量生成器
type Weekday int

const (
  Sunday Weekday = iota // 0
  Monday // 1
  Tuesday // 2
  Wednesday //3
  Thursday // ...
  Friday
  Saturday
)
  1. Println 与 Printf

    • Println :可以打印出字符串,和变量
    • Printf : 只可以打印出格式化的字符串,可以输出字符串类型的变量,不可以输出整形变量和整形
  2. 注释

    • 单行注释
        //
      
    • 多行注释
        /*
        */
      
  3. godoc

Directories

Path Synopsis
模拟枚举
模拟枚举

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL