LoginSignup
2

More than 3 years have passed since last update.

Goでデフォルト引数をつかいたーい

Posted at

できへん。。

が、構造体にしてそっち編集すればいいんじゃない案がよさそう。
https://stackoverflow.com/a/13603885

試してみたけど、副効果としてスッキリ感がすごい!

func hoge(s string, p *ppp, fugaMap map[int]string, ch *chan fugafuga, wg *sync.Waitgroup){
}
type struct hogeParam {
    s string
    p *ppp
    fugaMap map[int]string
    ch *chan fugafuga
    wg *sync.Waitgroup
}
func hoge(p *hogeParam){
}

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2