Errors importing package

I have a go app with this structure:

rschluet-general-ledger (the project directory)
     -administration
            -administration.go
    -archithreadsdb
            -archithreadsdb.go
    -main.go

I use this same setup for a number of other packages and they work fine

main.go has

import (
	"rschluet-general-ledger/archithreadsdb"
)
main()
	uniqueIdentifier := archithreadsdb.NewUniqueIdentifier()
	fmt.Println(uniqueIdentifier)
...

I have other packages setup with this same structure and imports and they work fine. In this particular case, I get these errors:

./main.go:4:2: imported and not used: "rschluet-general-ledger/archithreadsdb" as archithreadsDB
./main.go:105:22: undefined: archithreadsdb

Obviously, archithreadsdb IS used. If I purposely create an error in archithreadsdb, that error is reported:

archithreadsdb/archithreadsdb.go:17:2: undefined: cxcxcvx

so I know the compiler is processing archithreadsdb first with no errors(after removing the purposeful error.

I tried calling archithreadsdb from administration package and got the same errors.

It seems as if rschluet-general-ledger/archithreadsdb defines its own package name as archithreadsDB (uppercase “DB”), while you use archithreadsdb (lowercase “db”) in your code.

3 Likes

Thanks, Norbert, sometimes you just need another pair of eyes on an issue. I guess my eyes are not case-sensitive. I changed archithreadsdb to arDB everywhere and it works and easier to work with.

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