Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to run Hello world #755

Closed
3 tasks done
nlamirault opened this issue Nov 29, 2016 · 5 comments
Closed
3 tasks done

Failed to run Hello world #755

nlamirault opened this issue Nov 29, 2016 · 5 comments
Assignees

Comments

@nlamirault
Copy link

Description

Checklist

  • Dependencies installed
  • No typos
  • Searched existing issues and docs

Expected behaviour

Run the hello world from documentation

Actual behaviour

Steps to reproduce

$ govendor init
$ go get -u github.com/labstack/echo
$ go run server.go
server.go:6:2: cannot find package "github.com/labstack/echo" in any of:
	/home/nlamirault/Apps/golang/src/github.com/nlamirault/toto/vendor/github.com/labstack/echo (vendor tree)
	/home/nlamirault/Apps/go/src/github.com/labstack/echo (from $GOROOT)
	/home/nlamirault/Apps/golang/src/github.com/labstack/echo (from $GOPATH)

Working code to debug

package main

import (
	"net/http"

	"github.com/labstack/echo"
)

func main() {
	e := echo.New()
	e.GET("/", func(c echo.Context) error {
		return c.String(http.StatusOK, "Hello, World!")
	})
	e.Logger.Fatal(e.Start(":1323"))
}

Version/commit

@hfogelberg
Copy link

I had the same problem. You need to import "github.com/labstack/echo/middleware" as well.

Could somebody update the docs, please?

@vishr
Copy link
Member

vishr commented Nov 29, 2016

You don't need middleware to run this example. Make sure you have set $GOPATH and your project is within it.

@vishr vishr self-assigned this Nov 29, 2016
@vishr vishr added the question label Nov 29, 2016
@nlamirault
Copy link
Author

Yes it is.

@vishr
Copy link
Member

vishr commented Nov 29, 2016

/home/nlamirault/Apps/golang/src/github.com/nlamirault/toto should be in GOPATH and use the following command to get the framework.

govendor fetch github.com/labstack/[email protected]

@nlamirault
Copy link
Author

This is the test :

[nlamirault]:~$ cd $GOPATH/src/github.com/nlamirault
[nlamirault]:~/Apps/golang/src/github.com/nlamirault$ mkdir foobar
[nlamirault]:~/Apps/golang/src/github.com/nlamirault$ cd foobar/
[nlamirault]:~/Apps/golang/src/github.com/nlamirault/foobar$ govendor init
[nlamirault]:~/Apps/golang/src/github.com/nlamirault/foobar$ govendor fetch github.com/labstack/[email protected]
[nlamirault]:~/Apps/golang/src/github.com/nlamirault/foobar$ vi main.go
[nlamirault]:~/Apps/golang/src/github.com/nlamirault/foobar$ cat main.go
package main

import (
        "net/http"

        "github.com/labstack/echo"
)

func main() {
        e := echo.New()
        e.GET("/", func(c echo.Context) error {
                return c.String(http.StatusOK, "Hello, World!")
        })
        e.Logger.Fatal(e.Start(":1323"))
}
[nlamirault]:~/Apps/golang/src/github.com/nlamirault/foobar$ go run main.go
# github.com/nlamirault/foobar/vendor/github.com/rsc/letsencrypt
vendor/github.com/rsc/letsencrypt/lets.go:674: not enough arguments in call to c.ObtainCertificate
vendor/github.com/rsc/letsencrypt/lets.go:731: undefined: acme.TLSSNI01ChallengeCertDomain
vendor/github.com/rsc/letsencrypt/lets.go:744: undefined: acme.TLSSNI01ChallengeCertDomain

@vishr vishr added the bug label Dec 2, 2016
vishr added a commit that referenced this issue Dec 2, 2016
Signed-off-by: Vishal Rana <[email protected]>
vishr added a commit that referenced this issue Dec 2, 2016
Signed-off-by: Vishal Rana <[email protected]>
@vishr vishr closed this as completed in 8d504c1 Dec 2, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants