002_go中的各种注释

一、struct结构体注释

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 @ 2017-11-18 21:11  arun_python  阅读(168)  评论(0)    收藏  举报