Mac OS X 配置指南

Mac OS X 配置指南

  • Docs
  • Blog

notes/golang

Go Language

defer

defer 语句会将函数推迟到外层函数返回之后执行。

推迟调用的函数其参数会立即求值,但直到外层函数返回前该函数都不会被调用。

package main

import "fmt"

func main() {
    defer fmt.Println("world")

    fmt.Println("hello")
}

输出为

hello 

world

Notes

echo

这里的例子是不是错了?

filehttp

It's simplse to build the file server using http.FileServer:

应该是

It's simple to build the file server using http.FileServer

Last updated on 2019-1-8 by wild-flame
  • defer
Docs
Mac OS 配置指南 | Mac OS Setup Guide乱七八糟的笔记
Projects
Leetcode solutionsJekyll simple猪瘟疫情可视化
More
BlogGitHub
Copyright © 2019 wild-flame