How to declare multiple constants in one line with Go

1 Answer

0 votes
package main

import "fmt"

func main() {
    const A, B = "go", 89
    
    fmt.Println(A)
    fmt.Println(B)
}




/*
run:

go
89

*/

 



answered Sep 20, 2020 by avibootz

Related questions

1 answer 217 views
1 answer 136 views
2 answers 126 views
2 answers 234 views
1 answer 296 views
...