So I want to create a library that I can use from a script / project I'm building. The library is called go_nessus, (full source code: http://github.com/kkirsche/go-nessus) but I'm having an issue when importing it.
An example of the go_nessus code:
# go-nessus/client
package go_nessus
import (
"fmt"
)
func (nessus *Nessus) MakeClient(host, port, accessKey, secretKey string) Nessus {
return Nessus{
Ip: fmt.Sprintf("%s", host),
Port: fmt.Sprintf("%s", port),
AccessKey: fmt.Sprintf("%s", accessKey),
SecretKey: fmt.Sprintf("%s", secretKey),
}
}
When attempting to use this though I get the following error:
~/g/G/s/g/k/attempt ❯❯❯ go install -race && $GOPATH/bin/attempt
# github.com/kkirsche/attempt
./attempt.go:6: undefined: go_nessus.MakeClient
The test file looks like so:
package main
import "github.com/kkirsche/go-nessus"
func main() {
nessusClient := go_nessus.MakeClient("localhost", "8834", "ExampleAccessKey", "ExampleSecretKey")
}
I sadly though can't figure out how to actually use the methods I've created without errors. Any help would be greatly appreciated in figuring out what's wrong with my import process.
My go env
:
GOARCH="amd64"
GOBIN="/Users/kkirsche/git/Go/bin"
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/kkirsche/git/Go"
GORACE=""
GOROOT="/usr/local/go"
GOTOOLDIR="/usr/local/go/pkg/tool/darwin_amd64"
GO15VENDOREXPERIMENT=""
CC="clang"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fno-common"
CXX="clang++"
CGO_ENABLED="1"