package
0.0.0-20240726051332-daefc61aa0cc
Repository: https://github.com/chandrareddyp/golang.git
Documentation: pkg.go.dev
# README
Functions
Functions in Go can take zero or more arguments.
To make Go code easier to read, the variable type comes after the variable name.
For example, the following function:
func sub(x int, y int) int {
return x-y
}
Accepts two integer parameters and returns another integer.
Here, func sub(x int, y int) int
is known as the "function signature".
Assignment
We often will need to manipulate strings in our messaging app. For example, adding some personalization by using a customer's name within a template. The concat
function should take two strings and smash them together.
hello
+world
=helloworld
Fix the function signature of concat
to reflect its behavior.