github.com/lmorg/murex@v0.0.0-20240217211045-e081c89cd4ef/utils/docgen/api/unmarshaller.go (about)

     1  package docgen
     2  
     3  import (
     4  	"fmt"
     5  
     6  	yaml "gopkg.in/yaml.v3"
     7  )
     8  
     9  func parseSourceFile(path string, structure interface{}) {
    10  	f := fileReader(path)
    11  	b := readAll(f)
    12  
    13  	err := yaml.Unmarshal(b, structure)
    14  	if err != nil {
    15  		panic(fmt.Sprintf("%s (%s)", err.Error(), path))
    16  	}
    17  }