Custom Search

Wednesday, May 17, 2017

Golang Go no new variables on left side of :=


$vim test.go

package main

import "fmt"

func main() {
    //var age int = 42
    //age := 42
    var age int
    age := 42
    fmt.Printf("%#v\n", age)
}




OutPut:
======

$go run test.go
# command-line-arguments
./test.go:8: no new variables on left side of :=
$

No comments:

Post a Comment