You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

21 lines
338 B

package xlsx
import (
"encoding/xml"
"fmt"
)
func getCharData(d *xml.Decoder) (string, error) {
tok, err := d.Token()
if err != nil {
return "", fmt.Errorf("unable to get raw token: %w", err)
}
cdata, ok := tok.(xml.CharData)
if !ok {
// Valid for no chardata to be present
return "", nil
}
return string(cdata), nil
}