FAQ
I get this type of error for any non-standard lib package I try to use.
  I'm running go1.1.2 but have also tried 1.2rc1 with a similar but
different error.
./server.go:7: import
/Users/jayson/workspace/Go/pkg/darwin_amd64/github.com/gorilla/mux.a: not a
package file

Here's the code:

package main

import (
   "rexbro"
   "fmt"
   "net/http"
   "github.com/gorilla/mux"
   // "os"
   "encoding/json"
)

// var router = new(mux.Router)
const port = ":3000"

func main() {
   r := mux.NewRouter()
   r.HandleFunc("/", HomeHandler)
   r.HandleFunc("/free_agents", FreeAgentHandler)
   http.Handle("/", r)
   http.ListenAndServe(port, nil)
}


HELP!

--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Search Discussions

  • Kamil Kisiel at Sep 25, 2013 at 4:10 pm
    What happens when you delete /Users/jayson/workspace/Go/pkg/ ?
    On Wednesday, September 25, 2013 9:02:59 AM UTC-7, Jayson Bailey wrote:

    I get this type of error for any non-standard lib package I try to use.
    I'm running go1.1.2 but have also tried 1.2rc1 with a similar but
    different error.
    ./server.go:7: import /Users/jayson/workspace/Go/pkg/darwin_amd64/
    github.com/gorilla/mux.a: not a package file

    Here's the code:

    package main

    import (
    "rexbro"
    "fmt"
    "net/http"
    "github.com/gorilla/mux"
    // "os"
    "encoding/json"
    )

    // var router = new(mux.Router)
    const port = ":3000"

    func main() {
    r := mux.NewRouter()
    r.HandleFunc("/", HomeHandler)
    r.HandleFunc("/free_agents", FreeAgentHandler)
    http.Handle("/", r)
    http.ListenAndServe(port, nil)
    }


    HELP!
    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Jayson Bailey at Sep 25, 2013 at 4:18 pm
    Bam, it works! That means something was wrong with the package file?
    On Wednesday, September 25, 2013 10:10:50 AM UTC-6, Kamil Kisiel wrote:

    What happens when you delete /Users/jayson/workspace/Go/pkg/ ?
    On Wednesday, September 25, 2013 9:02:59 AM UTC-7, Jayson Bailey wrote:

    I get this type of error for any non-standard lib package I try to use.
    I'm running go1.1.2 but have also tried 1.2rc1 with a similar but
    different error.
    ./server.go:7: import /Users/jayson/workspace/Go/pkg/darwin_amd64/
    github.com/gorilla/mux.a: not a package file

    Here's the code:

    package main

    import (
    "rexbro"
    "fmt"
    "net/http"
    "github.com/gorilla/mux"
    // "os"
    "encoding/json"
    )

    // var router = new(mux.Router)
    const port = ":3000"

    func main() {
    r := mux.NewRouter()
    r.HandleFunc("/", HomeHandler)
    r.HandleFunc("/free_agents", FreeAgentHandler)
    http.Handle("/", r)
    http.ListenAndServe(port, nil)
    }


    HELP!
    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupgolang-nuts @
categoriesgo
postedSep 25, '13 at 4:03p
activeSep 25, '13 at 4:18p
posts3
users2
websitegolang.org

2 users in discussion

Jayson Bailey: 2 posts Kamil Kisiel: 1 post

People

Translate

site design / logo © 2022 Grokbase