👊
Go tutorial for Pythoner
  • Introduction
  • Install and Run Go
  • The structure of Go
    • First time you meet him
    • Functions
    • Return multiple results
    • Logic Control
    • Break loop and enumerate
    • List (Array or Slice)
    • Dict (Map)
    • Struct
    • Class (Methods)
    • Packages
  • Features of Go
  • Go modules
  • Web Server
    • Serving static files
    • A simple webserver
  • Go for Android
  • Where to go next
Powered by GitBook
On this page
  • Codes:
  • Output:

Was this helpful?

  1. The structure of Go

Functions

Codes:

package main

import "fmt"

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

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

func main() {
    fmt.Println(add1(2, 3))
    fmt.Println(add1(3, 3))
}

Output:

5
6
PreviousFirst time you meet himNextReturn multiple results

Last updated 4 years ago

Was this helpful?