Fork the repo if you want to help improve it. :)
You may also check Hyperpolyglot C, Go, Swift: a side-by-side reference sheet
BASICS
Hello World
Swift
print("Hello, world!")
Go
package main

import "fmt"

func main() {
    fmt.Println("Hello, world!")
}
Variables And Constants
Swift
var myVariable = 42
myVariable = 50
let myConstant = 42
Go
var myVariable = 42
myVariable = 50
const myConstant = 42
Explicit Types
Swift
let explicitDouble: Double = 70
Go
const explicitDouble float64 = 70
Type Coercion
Swift
let label = "The width is "
let width = 94
let widthLabel = label + String(width)
Go
const label = "The width is "
const width = 94
var widthLabel = label + strconv.Itoa(width)
String Interpolation
Swift
let apples = 3
let oranges = 5
let fruitSummary = "I have \(apples + oranges) " +
                   "pieces of fruit."
Go
const apples = 3
const oranges = 5
fruitSummary := fmt.Sprintf("I have %d pieces of fruit.", apples + oranges)
Range Operator
Swift
let names = ["Anna", "Alex", "Brian", "Jack"]
let count = names.count
for i in 0..count {
    print("Person \(i + 1) is called \(names[i])")
}
// Person 1 is called Anna
// Person 2 is called Alex
// Person 3 is called Brian
// Person 4 is called Jack
Go
names := [4]string{"Anna", "Alex", "Brian", "Jack"}
for i, value := range(names) {
    fmt.Printf("Person %v is called %v\n", (i + 1), value)
}
// Person 1 is called Anna
// Person 2 is called Alex
// Person 3 is called Brian
// Person 4 is called Jack
Inclusive Range Operator
Swift
for index in 1...5 {
    print("\(index) times 5 is \(index * 5)")
}
// 1 times 5 is 5
// 2 times 5 is 10
// 3 times 5 is 15
// 4 times 5 is 20
// 5 times 5 is 25
Go
for i := 1; i <= 5; i++ {
    fmt.Printf("%d times 5 is %d", i, i*5)
}
// 1 times 5 is 5
// 2 times 5 is 10
// 3 times 5 is 15
// 4 times 5 is 20
// 5 times 5 is 25
COLLECTIONS
Arrays
Swift
var shoppingList = ["catfish", "water",
    "tulips", "blue paint"]
shoppingList[1] = "bottle of water"
Go
var shoppingList = []string{"catfish", "water",
    "tulips", "blue paint"}
shoppingList[1] = "bottle of water"
Maps
Swift
var occupations = [
    "Malcolm": "Captain",
    "Kaylee": "Mechanic",
]
occupations["Jayne"] = "Public Relations"
Go
var occupations = map[string]string{
    "Malcolm": "Captain",
    "Kaylee": "Mechanic",
}
occupations["Jayne"] = "Public Relations"
Empty Collections
Swift
let emptyArray = [String]()
let emptyDictionary = [String: Float]()
let emptyArrayNoType = []
Go
var (
    emptyArray []string
    emptyDictionary = make(map[interface{}]interface{})
    emptyArrayNoType []interface{}
)
FUNCTIONS
Functions
Swift
func greet(name: String, day: String) -> String {
    return "Hello \(name), today is \(day)."
}
greet("Bob", "Tuesday")
Go
func greet(name, day string) string {
    return fmt.Sprintf("Hello %v, today is %v.", name, day)
}

func main() {
    greet("Bob", "Tuesday")
}
Tuple Return
Swift
func getGasPrices() -> (Double, Double, Double) {
    return (3.59, 3.69, 3.79)
}
Go
func getGasPrices() (float64, float64, float64) {
    return 3.59, 3.69, 3.79
}
Variable Number Of Arguments
Swift
func sumOf(numbers: Int...) -> Int {
    var sum = 0
    for number in numbers {
        sum += number
    }
    return sum
}
sumOf(42, 597, 12)
Go
func sumOf(numbers ...int) int {
    var sum = 0
    for _, number := range(numbers) {
        sum += number
    }
    return sum
}

func main() {
    sumOf(42, 597, 12)
    sumOf([]int{42, 597, 12}...)
}
Function Type
Swift
func makeIncrementer() -> (Int -> Int) {
    func addOne(number: Int) -> Int {
        return 1 + number
    }
    return addOne
}
var increment = makeIncrementer()
increment(7)
Go
func makeIncrementer() func(int) int {
    return func (number int) int {
        return 1 + number
    }
}

func main() {
    increment := makeIncrementer()
    increment(7)
}
Map
Swift
var numbers = [20, 19, 7, 12]
numbers.map({ number in 3 * number })
Go
mapFunc := func(slice interface{}, fn func(a interface{}) interface{}) interface{} {
    val := reflect.ValueOf(slice)
    out := reflect.MakeSlice(reflect.TypeOf(slice), val.Len(), val.Cap())
    for i := 0; i < val.Len(); i++ {
        out.Index(i).Set(
            reflect.ValueOf(fn(val.Index(i).Interface())),
        )
    }
    return out.Interface()
}
a := mapFunc([]int{1, 2, 3, 4}, func(val interface{}) interface{} {
    return val.(int) * 3
})
Sort
Swift
sort([1, 5, 3, 12, 2]) { $0 > $1 }
Go
sort.Sort(sort.Reverse(sort.IntSlice([]int{1, 5, 3, 12, 2})))
Named Arguments
Swift
def area(width: Int, height: Int) -> Int {
    return width * height
}

area(width: 10, height: 10)
Go
CLASSES
Declaration
Swift
class Shape {
    var numberOfSides = 0
    func simpleDescription() -> String {
        return "A shape with \(numberOfSides) sides."
    }
}
Go
type Shape struct {
    numberOfSides int
}
func (p *Shape) simpleDescription() string {
    return fmt.Sprintf("A shape with %d sides.", p.numberOfSides)
}
Usage
Swift
var shape = Shape()
shape.numberOfSides = 7
var shapeDescription = shape.simpleDescription()
Go
var shape = new(Shape)
shape.numberOfSides = 7
var shapeDescription = shape.simpleDescription()
Subclass
Swift
class NamedShape {
    var numberOfSides: Int = 0
    var name: String

    init(name: String) {
        self.name = name
    }

    func simpleDescription() -> String {
        return "A shape with \(numberOfSides) sides."
    }
}

class Square: NamedShape {
    var sideLength: Double

    init(sideLength: Double, name: String) {
        self.sideLength = sideLength
        super.init(name: name)
        numberOfSides = 4
    }

    func area() -> Double {
        return sideLength * sideLength
    }

    override func simpleDescription() -> String {
        return "A square with sides of length
                \(sideLength)."
    }
}

let test = Square(sideLength: 5.2, name: "square")
test.area()
test.simpleDescription()
Go
type NamedShape struct {
    numberOfSides int
    name string
}
func NewNamedShape(name string) *NamedShape {
    return &NamedShape{
        name: name,
    }
}
func (p *NamedShape) SimpleDescription() string {
    return fmt.Sprintf("A shape with %d sides.", p.numberOfSides)
}

type Square struct {
    *NamedShape
    sideLength float64
}
func NewSquare(sideLength float64, name string) *Square {
    return &Square{
        NamedShape: NewNamedShape(name),
        sideLength: sideLength,
    }
}
func (p *Square) Area() float64 {
    return p.sideLength * p.sideLength
}
func (p *Square) SimpleDescription() string {
    return fmt.Sprintf("A square with sides of length %d.", p.sideLength)
}

func main() {
    a := NewSquare(5.2, "square")
    a.Area()
    a.SimpleDescription()
}
Checking Type
Swift
var movieCount = 0
var songCount = 0

for item in library {
    if item is Movie {
        ++movieCount
    } else if item is Song {
        ++songCount
    }
}
Go
var movieCount = 0
var songCount = 0

for _, item := range(library) {
    if _, ok := item.(Movie); ok {
        movieCount++
    } else if _, ok := item.(Song); ok {
        songCount++
    }
}
Downcasting
Swift
for object in someObjects {
    let movie = object as Movie
    print("Movie: '\(movie.name)', dir. \(movie.director)")
}
Go
for object := range someObjects {
    movie := object.(Movie)
    fmt.Printf("Movie: '%s', dir. %s", movie.name, movie.director)
}
Protocol
Swift
protocol Nameable {
    func name() -> String
}

func f(x: T) {
    print("Name is " + x.name())
}
Go
type Nameabler interface {
    func Name() string
}

func F(x Nameabler) {
    fmt.Println("Name is " + x.Name())
}
Extensions
Swift
extension Double {
    var km: Double { return self * 1_000.0 }
    var m: Double { return self }
    var cm: Double { return self / 100.0 }
    var mm: Double { return self / 1_000.0 }
    var ft: Double { return self / 3.28084 }
}
let oneInch = 25.4.mm
print("One inch is \(oneInch) meters")
// prints "One inch is 0.0254 meters"
let threeFeet = 3.ft
print("Three feet is \(threeFeet) meters")
// prints "Three feet is 0.914399970739201 meters"
Go
type double float64

func (d double) km() double { return d * 1000 }
func (d double) m() double  { return d }
func (d double) cm() double { return d / 100 }
func (d double) mm() double { return d / 1000 }
func (d double) ft() double { return d / 3.28084 }

func main() {
    var oneInch = double(25.4).mm()
    fmt.Printf("One inch is %v meters\n", oneInch)
    // prints "One inch is 0.0254 meters"

    var threeFeet = double(3).ft()
    fmt.Printf("Three feet is %v meters\n", threeFeet)
    // prints "Three feet is 0.914399970739201 meters"
}