This example will be a little bare to strip out the custom xml parsing that I'm doing, but I've run into this issue:
package main
import (
"encoding/xml"
"fmt"
)
type Foo string
func main() {
var f Foo
var b string
c := xml.CharData{}
f = string(c)
b = string(c)
fmt.Println(b)
}
//prog.go:15: cannot use string(c) (type string) as type Foo in assignment
Foo is a type of string, what am I missing to convert the string representation of xml.CharData (which is valid, use it in many decoders) to a custom type which is a string?