Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
224 views
in Technique[技术] by (71.8m points)

go - Google App Engine cant build

Im having problem with building my project, i.e, "goapp serve".

I get this message:

Failed to build Go application: (Executed command: /Users/simon/go_appengine/goroot/bin/go-app-builder -app_base /Users/simon/Programming/golang_projects/src/googleglass_backend -arch 6 -dynamic -goroot /Users/simon/go_appengine/goroot -gopath /Users/simon/Programming/golang_projects -nobuild_files ^^$ -incremental_rebuild -unsafe -print_extras_hash handlers/mainpage.go types/user.go types/data.go handlers/utils.go server.go)

2017/01/16 14:04:30 go-app-builder: Failed parsing input: app file data.go conflicts with same file imported from GOPATH

My project structure looks like this:

 golang_projects
    bin
       ...
    pkg
       ...
    src
       googleglass_backend
           app.yaml
           handlers
               utils.go
               mainpage.go
           index.yaml
           server.go
           types
               data.go
               user.go

My GOPATH looks like this:

/Users/simon/Programming/golang_projects

I dont know what data.go could be conflicting with?

My server.go file:

package main

import (
    "googleglass_backend/handlers"
    "googleglass_backend/types"

    "github.com/gorilla/mux"
    "encoding/gob"

    "net/http"

    "github.com/rs/cors"
)

func init() {
    router := mux.NewRouter()
    gob.Register(types.User{})
    //For all includes in html files
    router.PathPrefix("/static/").Handler(http.StripPrefix("/static/", http.FileServer(http.Dir("web/static/"))))

    router.HandleFunc("/", handlers.IndexTemplate)
    handler := cors.Default().Handler(router)
    http.Handle("/", handler)

}

Contents of data.go:

package types

import (
    "time"
)

type Data struct {
    xaxis        int
    yaxis        int
    beacon_1     int
    beacon_2     int
    beacon_3     int
    RegisterTime time.Time
}
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...