Suppose I have two files.
hello.go
package main
type StringA string
func main() {
var s StringA
s = "hello"
s0 := s.(StringB) <---- somehow cast my StringA to StringB. After all, they are both strings
s0.Greetings()
}
bye.go
package main
import "fmt"
type StringB string
func (s StringB) Greetings(){
fmt.Println(s)
}
And compile this like this:
go build hello.go bye.go
How do I cast StringA
to the type StringB
?
Thanks