New to GO - Applications runs but no output/not error?

Hi,

I’m struggling a bit trying to import a package. I would expect the program to the either throw an error or output the expected results which should just be a line of text /w data. The package is a binary parser, but I seem to just get an output message of which seems to only the reference the package and its contents.

Output
`
tecid.go:7:2: found packages d2s (attributes.go) and main (tecid.go) in C:\Users\Winston (Work)\go\src\github.com\nokka\d2s

Code

package main

import (
	"fmt"
	"log"
	"os"
	"github.com/nokka/d2s"
)



func main() {
	path := "nokka.d2s"
	file, err := os.Open(path)
	if err != nil {
		log.Fatal("Error while opening .d2s file", err)
	}

	defer file.Close()

	char, err := d2s.Parse(file)
	if err != nil {
		log.Fatal(err)
	}

	// Prints character name and class.
	fmt.Println(char.Header.Name)
	fmt.Println(char.Header.Class)
}


I'm sure it's simple/maybe install conflict. Any suggestion is appreciated.

Thank you.

You have another file that has a package d2s in the same folder as a file that contains package main. This is not allowed in go, you need to move one of the packages to another folder.

2 Likes

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.