docs: add godoc comments to all exported functions and methods

This commit is contained in:
adman
2026-07-30 00:20:55 +02:00
parent 56c97a2b3f
commit 0d6b6e1ab9
50 changed files with 186 additions and 408 deletions
+3
View File
@@ -94,6 +94,7 @@ type Structure struct {
Version string
}
// LoadFromPath loads a litematic file from disk.
func LoadFromPath(path string) (s *Structure, err error) {
f, err := os.Open(path)
if err != nil {
@@ -104,6 +105,7 @@ func LoadFromPath(path string) (s *Structure, err error) {
return
}
// LoadFromFile reads and parses a litematic file from a reader.
func LoadFromFile(r io.Reader) (s *Structure, err error) {
n, err := nbt.ReadUnstructuredFile(r)
if err != nil {
@@ -112,6 +114,7 @@ func LoadFromFile(r io.Reader) (s *Structure, err error) {
return Load(n.Value)
}
// Load decodes raw NBT data into a litematic Structure.
func Load(v any) (s *Structure, err error) {
s = &Structure{}
err = mapstructure.Decode(v, &s.File)