Skip to content

Instantly share code, notes, and snippets.

@kwmt
Last active December 24, 2015 18:09
Show Gist options
  • Select an option

  • Save kwmt/6840821 to your computer and use it in GitHub Desktop.

Select an option

Save kwmt/6840821 to your computer and use it in GitHub Desktop.
関数の引数をオプション的に扱う方法
package main
import "fmt"
func main() {
f("arg")
f()
}
func f(s ...string) {
fmt.Println(s)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment