Learn Go: Functions
Learn how to write Go functions in this action-packed course!
StartKey Concepts
Review core concepts you need to learn to master this subject
Go Pass by Value Parameter
Go Pass by Value Parameter
When a Go function parameter is passed by value, it means only a copy of the value is accessed and manipulated inside the function. The original value of the variable that is passed as an argument to the function remains intact.
func makeMeOlder(age int) { age += 5 } func main() { myAge := 10 makeMeOlder(myAge) fmt.Println(myAge) // myAge is still 10 }
Learn Go: Functions
Lesson 1 of 2
What you'll create
Portfolio projects that showcase your new skills
How you'll master it
Stress-test your knowledge with quizzes that help commit syntax to memory