Skip to content
Quiz · Interfaces · lesson 6 of 10

Quiz — type assertion and nil

Question 1 of 2

What does the program print?

GO
package main

import "fmt"

func main() {
    var v any = 42
    s, ok := v.(string)
    fmt.Println(len(s), ok)
}

Subscribe to take the course

The course is free. Sign in with Telegram and subscribe to the channel to open every lesson.

Sign in another way