package
0.0.0-20241013142502-5d60ab684245
Repository: https://github.com/mithunkumarc/golang-learning.git
Documentation: pkg.go.dev

# README

function syntax :

    func receiver identifier(parameters) returnType {
      //body
    }
    
    // receiver : optional
// if a function is returning value, returnType is mandatory

curly braces must start at the end of function declaration

    // error, reason: end of line golang compiler puts semicolumns default
    func main() 	// at the end golang compiler puts semicolums and it it think funciton body is missing
    {
      fmt.Println("Hello, playground")
    }
    
    // ok
    func main() {
        fmt.Println("Hello, playground")
    }

When two or more consecutive named function parameters share a type, you can omit the type from all but the last.

func add(x, y int) int {
	return x + y
}