How to declare a constant string in Go

1 Answer

0 votes
package main

import "fmt"

func main() {
    const str = "abc"
    
    fmt.Println(str)
}



/*
run:

abc

*/

 



answered Jun 19, 2025 by avibootz

Related questions

...