Questions
Go questions
Choose a question page, learn the concept, then test your understanding with a quiz.
Check if a Value Exists in a Slice in Go
Learn how to check whether a value exists in a slice in Go, and why Go has no Python-style `in` operator for arrays or slices.
Concatenating Slices in Go with append
Learn how to concatenate two slices in Go using append and the ... operator, with examples, pitfalls, and practical usage.
Convert String to Integer in Go: Idiomatic Parsing with strconv.Atoi
Learn the idiomatic way to convert a string to an int in Go using strconv.Atoi, with examples, errors, and common mistakes.
Convert a Zero-Terminated Byte Array to String in Go
Learn how to convert a zero-terminated byte array to a Go string by trimming trailing null bytes safely and clearly.
Difference Between := and = in Go
Learn the difference between := and = in Go, when to declare versus assign variables, and common mistakes beginners make.
Efficient String Concatenation in Go: strings.Builder, bytes.Buffer, and Best Practices
Learn how to concatenate strings efficiently in Go using strings.Builder and bytes.Buffer, with examples and common pitfalls.
Go Method Receiver Syntax Explained: Parentheses Before a Function Name
Learn what `(h handler)` and `(s *GracefulServer)` mean in Go function declarations and how method receivers work.
Go Pointers vs Values in Parameters and Return Values
Learn when to use structs, pointers, slices, and pointer receivers in Go parameters and return values with practical rules and examples.
Go Ternary Operator Equivalent: Idiomatic Conditional Assignment in Go
Learn the idiomatic Go alternative to C's ternary operator and how to write clear conditional assignment with if statements.
Go foreach Loop: How to Iterate with for range in Go
Learn how Go handles foreach-style iteration using for range to loop over slices, arrays, maps, strings, and channels.
How Go Fetches Private GitHub Repositories and Fixes "terminal prompts disabled"
Learn why `go get` fails on private GitHub repos with "terminal prompts disabled" and how to configure Go and Git correctly.
How to Assign a String to a Byte Array in Go
Learn how to copy a string into a fixed-size byte array in Go, with examples, pitfalls, and practical patterns for safe conversion.
How to Check If a File Exists in Go
Learn the idiomatic way to check whether a file exists in Go using os.Stat, errors.Is, and proper error handling patterns.
How to Check Whether a Slice Contains a Value in Go
Learn how to check if a slice contains a value in Go, when linear search is required, and when to use maps instead of slices.
How to Check for an Empty String in Go
Learn the idiomatic way to test empty and non-empty strings in Go, with examples, comparisons, mistakes, and practical usage.
How to Check if a Map Contains a Key in Go
Learn how to test whether a key exists in a Go map using the idiomatic comma-ok pattern, with examples and common mistakes.
How to Compare Two Slices for Equality in Go
Learn how to check whether two slices are equal in Go, why == does not work, and how to compare slice contents safely.
How to Convert an int to a String in Go
Learn how to convert an int to a string in Go using strconv.Itoa and FormatInt, and why string(i) gives a character instead of digits.
How to Find the Type of an Object in Go
Learn how to inspect variable types in Go using reflect.TypeOf, %T, and type assertions with clear examples for beginners.
How to Format a String in Go Without Printing
Learn how to format and return strings in Go using fmt.Sprintf, with examples, comparisons, common mistakes, and a mini project.
Page 1 of 2 - 32 questions