-
Notifications
You must be signed in to change notification settings - Fork 8
Closed
Description
I'm getting the following error when I try to use gocannon as a library in a program:
> go build
main.go:9:2: import "github.com/kffl/gocannon" is a program, not an importable package
Code:
package main
import (
"fmt"
"os"
"runtime"
"time"
gocannon "github.com/kffl/gocannon"
"github.com/kffl/gocannon/common"
)
func main() {
duration := time.Second * 1
connections := 50
cpus := runtime.NumCPU()
timeout := time.Millisecond * 200
mode := "reqlog"
outputFile := ""
interval := time.Millisecond * 250
preallocate := 1000
method := "GET"
body := common.RawRequestBody{}
header := common.RequestHeaders{}
trustAll := false
format := "default"
plugin := ""
target := "http://localhost:8080/v1/dict/roles"
cfg := common.Config{
Duration: &duration,
Connections: &connections,
CPUs: &cpus,
Timeout: &timeout,
Mode: &mode,
OutputFile: &outputFile,
Interval: &interval,
Preallocate: &preallocate,
Method: &method,
Body: &body,
Headers: &header,
TrustAll: &trustAll,
Format: &format,
Plugin: &plugin,
Target: &target,
}
g, err := gocannon.NewGocannon(cfg)
if err != nil {
fmt.Println(err)
os.Exit(1)
}
g.Run()
}
kffl
Metadata
Metadata
Assignees
Labels
No labels