How to get a list of values into a flag in Golang?

后端 未结 4 1238
失恋的感觉
失恋的感觉 2020-12-13 03:53

What is Golang\'s equivalent of the below python commands ?

import argparse
parser = argparse.ArgumentParser(description=\"something\")
parser.add_argument(\         


        
4条回答
  •  情深已故
    2020-12-13 03:57

    Use flag.String() to get the entire list of values for the argument you need and then split it up into individual items with strings.Split().

提交回复
热议问题