1. What is an idiomatic way to customize the representation of a custom struct in a formatted string?
2. If you iterate over a map in a for range loop, in which order will the key:value pairs be accessed?
3. What is the correct syntax ta start a goroutine that will print Hello Gopher!?
4. How can you compile main.go to an executable that will run on OSX arm64 ?
5. What is the common way to have several executables in your project?
6. Which file names will the go test command recognize as test files?
7. How should you log an error (err)
8. Which is a valid Go time format literal?
9. What does log.Fatal do?
10. How is the behavior of t.Fatal different inside a t.Run?
11. Which encodings can you put in a string?
12. If your current working directory is the top level of your project, which command will run all its test packages?
13. How can you tell Go to import a package from a different location?
14. Which choice does not send output to standard error?
15. Where is the built-in recover method useful?
16. What is the risk of using multiple field tags in a single struct?
17. What is the difference between the time package’s Time.Sub() and Time.Add() methods?
18. What is the default case sensitivity of the JSON Unmarshal function?
19. A switch statement _ its own lexical block. Each case statement _ an additional lexical block.
20. What should the idiomatic name be for an interface with a single method and the signature Save() error?
21. What is the correct way to pass this as a body of an HTTP POST request? data := "A group of Owls is called a parliament"
22. How can you make a file build only on Windows?
23. What is a channel?
24. What restriction is there on the type of var to compile this i := myVal.(int)?
25. What is the select statement used for?
26. What is a side effect of using time.After in a select statement?
27. What is an idiomatic way to pause execution of the current scope until an arbitrary number of goroutines have returned?
28. What does a sync.Mutex block while it is locked?
29. How do you tell go test to print out the tests it is running?
30. From where is the variable myVar accessible if it is declared outside of any functions in a file in package myPackage located inside module myModule?
31. Which is the only valid import statement in Go?
32. What is the value of Read?
33. How will you add the number 3 to the right side? Values := []int{1, 1, 2}
34. Which is not a valid loop construct in Go?
35. What does the len() function return if passed a UTF-8 encoded string?
36. What do you need for two functions to be the same type?
Kotlin
Android
Eclipse
.NET Framework
HTML
HTML 5
Related MCQ's
Popular MCQ's