Skip to content

Conversation

hakuta
Copy link

@hakuta hakuta commented Dec 2, 2018

おみくじAPIを作ってみよう

  • JSON形式でおみくじの結果を返す
  • 正月(1/1-1/3)だけ大吉にする
    1/1~1/3のテストを書く際にinterfaceを定義したものをMockで差し替えるのを試してみました
  • ハンドラのテストを書いてみる

func main() {
f := fortune.NewFortune(fortune.DefaultClock{})
http.HandleFunc("/", f.Handler)
http.ListenAndServe(":8080", nil)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#52 (comment)
別の方のPRでも同じ話をしたのですが 8080 ポートが埋まっている場合も考慮してほしいです

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

コメントありがとうございます
flagでportを変更できるようにしました。
d191ee3

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

Successfully merging this pull request may close these issues.

2 participants