Skip to content

Failed to run Hello world #755

Closed
Closed

Description

@nlamirault

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

Activity

  1. hfogelberg commented on Nov 29, 2016

    @hfogelberg

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

    Could somebody update the docs, please?

  2. vishr commented on Nov 29, 2016

    @vishr
    Member

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

  3. self-assigned this
    on Nov 29, 2016
  4. nlamirault commented on Nov 29, 2016

    @nlamirault
    Author

    Yes it is.

  5. vishr commented on Nov 29, 2016

    @vishr
    Member

    /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/echo@v3.0

  6. nlamirault commented on Dec 2, 2016

    @nlamirault
    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/echo@v3.0
    [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
  7. added 2 commits that reference this issue on Dec 2, 2016
    81d2521
    7032ecc
  8. added a commit that references this issue on Apr 23, 2025
    8d504c1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions