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

appengine/go で go1.8になって死ぬ理由一覧 #5

Closed
vvakame opened this issue Oct 26, 2017 · 4 comments
Closed

appengine/go で go1.8になって死ぬ理由一覧 #5

vvakame opened this issue Oct 26, 2017 · 4 comments

Comments

@vvakame
Copy link
Member

vvakame commented Oct 26, 2017

みんな好きに書いてね!

@vvakame
Copy link
Member Author

vvakame commented Oct 26, 2017

  • うっひょー!!って netcontextをcontextに置き換えたらライブラリ内でリフレクションでcontext判定してるところが等値性判定しててassignable判定じゃなかったので死んでた
  • gorillaかなにかのmapのkeyをcontextにしててnetcontextとcontextの違いかなんかで意図通り値が取れなくなって死んでた

結論:netcontextとcontext周りで死ぬ

@vvakame
Copy link
Member Author

vvakame commented Oct 26, 2017

あとライブラリのビルドタグで死んだパターンも聞いた

@mstssk
Copy link

mstssk commented Oct 26, 2017

WARNING WriteHeader called multiple times on request. を放置しているといつの間にか挙動が変わっていた。

存在しないページではAngularにNotFound画面を出させつつ、検索エンジンのクローラのためにHTTPステータスコードを404を返そうとして↓みたいなコード書いていたら、 api_version: go1 のままだとレスポンスボディにindex.htmlが入らなくなった。

ucon.HandleFunc("GET", "/", func(w http.ResponseWriter, r *http.Request, c context.Context) {
	
	/** 中略 */

	if isAllowedPath(r.URL.Path) == false {
		w.WriteHeader(404) // SEOのため許容していないパスへのリクエストは404にする
	}
	http.ServeFile(w, r, "dist/index.html") // Angularのindex.html返す。※この中でもw.WriteHeader()は呼ばれている
})

api_version: go1.6 でデプロイしなおしたら従来の動作(レスポンスのステータスコードが404になりつつindex.htmlも落ちてくる)に戻った。

@vvakame
Copy link
Member Author

vvakame commented Oct 26, 2017

tenntennさんの記事も見るとよい

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants