002_go中的各种注释

一、struct结构体注释

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
package main
 
import (
    "fmt"
)
 
type PluginConfig struct {
    Enabled bool   `json:"enabled"`
    Dir     string `json:"dir"`
    Git     string `json:"git"`
    LogDir  string `json:"logs"`
    Age     int
}
 
 
func main() {
    var plugin *PluginConfig = new(PluginConfig)
/*  plugin.Enabled = true
    plugin.Dir = "/"
    plugin.Git = "git"
    plugin.LogDir = "logrecord"*/
    fmt.Printf("%t\n", plugin.Enabled)
    fmt.Printf("%s\n", plugin.Dir)
    fmt.Printf("%s\n", plugin.Git)
    fmt.Printf("%d\n", plugin.Age)
}

输出:

false


0

二、其他注释待填充。

posted @   arun_python  阅读(161)  评论(0编辑  收藏  举报
点击右上角即可分享
微信分享提示