-
Notifications
You must be signed in to change notification settings - Fork 17
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
Kadai4 tomoyuki.kobayashi #52
base: master
Are you sure you want to change the base?
Kadai4 tomoyuki.kobayashi #52
Conversation
…nsan/dojo4 into kadai3-tomoyuki.kobayashi
…nsan/dojo4 into kadai3-tomoyuki.kobayashi
``` | ||
./serve | ||
``` | ||
でポート8080で立ち上がるため下記などのようにしてリクエストしてください |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
僕のPCは諸般の事情で 8080 ポート埋まっているんですがなんとかなりませんか?
ヒント
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ありがとうございます。
ヒントでいただいているように、引数で与えられるようにするか、
":0"で指定して確保できたポートを出力するのが良さそうですね。
|
||
const ( | ||
// DAIKICHI 大吉 | ||
DAIKICHI = 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const (
DAIKICHI = iota
CYUKICHI
...
)
でも同じ結果になります。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ありがとうございます。確かに、iotaは省略可能でしたね。
|
||
/* | ||
NOTE 標本増やすためにランダムな時間を与えるのをtest.quickでできないか試してみたが | ||
reflect.Valueでpanicするので、timeはダメっぽい |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ここはtime.Timeをランダマイズするのではなく
configでunixtimeのレンジを決めて、intをランダムに与えるようにすればやりたいことはできそう
https://stackoverflow.com/questions/40944233/generating-random-timestamps-in-go
おみくじAPIを作ってみよう