(beta) Login local_offer
tags
mail
contact us

What is the output of the following Go code.

package main

import (  
    "fmt"
)

func hello() []string {  
    return nil
}

func main() {  
    h := hello
    if h == nil {
        fmt.Println("nil")
    } else {
        fmt.Println("not nil")
    }
}
Nov 11, 2019 14:02:46 UTC

What’s the output of the following GoLang code?

package main

import "fmt"

const (
	a = iota
	b = iota
	c = iota
)

const (
	d, e, f = iota, iota, iota
)

func main() {
	fmt.Println(a, b, c, d, e, f)
}
Nov 09, 2019 01:14:25 UTC