Skip to content

Instantly share code, notes, and snippets.

@steshaw
Created September 2, 2021 03:57
Show Gist options
  • Save steshaw/af163f806f92c58cb761800c711aae31 to your computer and use it in GitHub Desktop.
Save steshaw/af163f806f92c58cb761800c711aae31 to your computer and use it in GitHub Desktop.
package main
import (
"fmt"
)
type StructTag string // Creates a new type :-)
func main() {
var st StructTag = "foo"
fmt.Printf("st = %s\n", st)
var s = "bar"
fmt.Printf("s = %s\n", s)
st = StructTag(s)
fmt.Printf("st = %s\n", st)
s = string(st)
fmt.Printf("s = %s\n", s)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment