我的站点

一个系统软件工程师的随手涂鸦

Date: 八月 29, 2016

Go语言实践技巧(16)——打印结构体使用“%+v”

Go语言中打印结构体推荐使用“%+v”,而不是“%v”。看一下二者区别:

package main

import "fmt"

type info struct {
    name string
    id int
}

func main()  {
    v := info{"Nan", 33}
    fmt.Printf("%v\n", v)
    fmt.Printf("%+v\n", v)
}

运行结果如下:

{Nan 33}
{name:Nan id:33}

FreeBSD kernel 笔记(12)——kproc_create

下文摘自FreeBSD Kernel Developer’s Manual

The kproc_create() function is used to create a kernel process. The new process shares its address space with process 0, the swapper process, and runs in kernel mode only.

 

Powered by WordPress & Theme by Anders Norén