Files
learngo/06-variables/06-project-greeter/questions/questions.md
2018-10-15 19:34:48 +03:00

996 B

What's does os.Args variable store in its first item?

  • The first argument that is passed to the program
  • The second argument that is passed to the program
  • Path to the running program CORRECT

What's the type of the Args variable?

var Args []string
  • string
  • string array
  • a slice of strings CORRECT

What is the type of each value in the Args variable?

var Args []string
  • string CORRECT
  • string array
  • a slice of strings

How to get the first item of the Args variable?

var Args []string
  • Args.0
  • Args{1}
  • Args[0] CORRECT
  • Args(1)

How to get the second item of the Args variable?

var Args []string
  • Args.2
  • Args[1] CORRECT
  • Args{1}
  • Args(2)

How to get the length of the Args variable?

var Args []string
  • length(Args)
  • Args.len
  • len(Args) CORRECT
  • Args.Length

How to get the first "argument" from the command-line?

  • os.Args[0]
  • os.Args[1] CORRECT
  • os.Args[2]
  • os.Args[3]