flashmob / go-guerrilla

Mini SMTP server written in golang
MIT License
2.79k stars 366 forks source link

Issue with importing go-guerrilla as a package #133

Closed FUSAKLA closed 5 years ago

FUSAKLA commented 5 years ago

Hi, I'd like to use go-guerrilla as a package but unfortunately fail to get it working. I'm using the default example from https://github.com/flashmob/go-guerrilla/wiki/Using-as-a-package

package main
import (
    "fmt"
    "github.com/flashmob/go-guerrilla/guerrilla"
)
func main() {
    d := guerrilla.Daemon{}
    err := d.Start()
    if err == nil {
        fmt.Println("Server Started!")
    }
}

But Go fails to find the guerrilla package during build.

The issue is it fails to get the github.com/flashmob/go-guerrilla/guerrilla package at all.

$ go version
go version go1.11.2 linux/amd64

The error is:

go get github.com/flashmob/go-guerrilla/guerrilla
package github.com/flashmob/go-guerrilla/guerrilla: cannot find package "github.com/flashmob/go-guerrilla/guerrilla" in any of:
    /usr/local/go/src/github.com/flashmob/go-guerrilla/guerrilla (from $GOROOT)
    /go/src/github.com/flashmob/go-guerrilla/guerrilla (from $GOPATH)

I tried in docker for golang versions 1.9, 1.10 and 1.11 and neither works.

FUSAKLA commented 5 years ago

Hm.. using just import "github.com/flashmob/go-guerrilla" works but go imports unfortunately auto-completes this by adding the /guerrilla to it.

Also might be worth to fix in the docs.

flashmob commented 5 years ago

Thanks! Fixed.