pranavkv
(PRANAV KV)
September 24, 2022, 2:00pm
1
Function Undefined while using it from same package
Unable to find out what is going wrong here.
Newly created 2 Files LibConfig and LibSQL, but LibConfig is undefined while calling a function in LibConfig from LibSQL.
NOTE: i want to install this complete project as package to local and use it in other projects
go.mod file here
module GitHub - pranavkv/golib_v1
go 1.18
require (
)
I can import all the functions from files other than LibConfig.
Please help to identify the issue
skillian
(Sean Killian)
September 24, 2022, 4:24pm
2
Files within the same directory are all part of the same package. Try removing the LibConfig.
prefix
pranavkv
(PRANAV KV)
September 25, 2022, 8:04am
3
Hi @skillian Could you please let me know how we can install this locally and use it in other projects. Currently i had to commit all the changes to github and create a tag to use it in other projects. Anyway to build and install locally and use it ?
this is how i use it in another project
equire (
GitHub - pranavkv/golib_v1 v1.0.1
)
skillian
(Sean Killian)
September 25, 2022, 12:22pm
4
You could add to the other projectβs go.mod file:
replace github.com/pranavkv/golib_v1 => ../golib_v1
Assuming your golib_v1 is beside your other project folder, for example:
./
ββ golib_v1/
ββ other_project/
ββ go.mod β This is where you add the replace for ../golib_v1
1 Like
system
(system)
Closed
December 28, 2022, 11:56am
6
This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.