I created a library called libfastget which is in src with my program as
src |-libfastget | |-libfastget.go | |-MainProgram |-main.go
and libfastget exports funtion fastget as follows
package libfastget import ( "fmt" "io" ) func fastget(urlPtr *string, nPtr *int, outFilePtr *string) download { ..... return dl }
When I use the library in my main program
package main import ( "fmt" "net/http" "os" "libfastget" "path/filepath" "strings" "flag" "time" ) func uploadFunc(w http.ResponseWriter, r *http.Request) { n:=libfastget.fastget(url,4,filename) } }
I get the following error when trying to build using go build
It is strange that the library file libfastget.a is present in the pkg folder.
go
Shenal silva
source share