go-xml icon indicating copy to clipboard operation
go-xml copied to clipboard

cli.go:57 lacks error checking

Open john8329 opened this issue 1 year ago • 0 comments

There's a missing error check in the mentioned file, so a file reading error is ignored. It should be trivial to fix.

// GenAST creates an *ast.File containing type declarations and
// associated methods based on a set of XML schema.
func (cfg *Config) GenAST(files ...string) (*ast.File, error) {
	data, err := cfg.readFiles(files...)
// HERE
	code, err := cfg.GenCode(data...)
	if err != nil {
		return nil, err
	}
	return code.GenAST()
}

Thanks

john8329 avatar Sep 27 '24 09:09 john8329