<p>The other day, I posted about a <a href="https://www.reddit.com/r/golang/comments/3lmgt8/learning_go_so_built_a_simple_terminal_weather_app/">weather cli app</a> I wrote by learning Go. Thanks to your support and input, I have updated it to version 2. It now supports forecast up to 16 days.</p>
<p>Check it out on Github!
<a href="https://github.com/kenhkelly/GoWeather">https://github.com/kenhkelly/GoWeather</a></p>
<p>If you have feature suggestions, please let me know. I'd like to have some more ideas on what to add to it. </p>
<hr/>**评论:**<br/><br/>jjolla888: <pre><p>is that Celsius or Kelvin ?</p></pre>kenhkelly: <pre><p>Default is Imperial but it supports Celsius. I'm going to add support for Kelvin too. </p></pre>jjolla888: <pre><p>the reason i mention is that your examples with "-unit=celcius" seem to be returning Kelvin ... this may be that you have misspelled "celsius" .. and the website is returning a default Kelvin</p></pre>kenhkelly: <pre><p>Ah! Thanks for pointing that out. I updated the README. The option is unit with options imperial (default) and metric</p></pre>hugthemachines: <pre><p>Is there really a temperature unit in the imperial system?</p></pre>kenhkelly: <pre><p>Fahrenheit</p></pre>hugthemachines: <pre><p>Yeah, I tried to find it in this: </p>
<p><a href="https://en.wikipedia.org/wiki/System_of_measurement" rel="nofollow">https://en.wikipedia.org/wiki/System_of_measurement</a></p>
<p>But no luck.</p></pre>kenhkelly: <pre><p>I stuck with what the API service I'm using calls it. </p>
<p>It's listed here. <a href="https://en.wikipedia.org/wiki/Category:Imperial_units" rel="nofollow">https://en.wikipedia.org/wiki/Category:Imperial_units</a></p></pre>FrenchDonkey: <pre><p>Quick nit and everywhere</p>
<pre><code>var (
key, val, unit string
days int
)
</code></pre>
<p>resp, err := http.Get(API + params)
IMO, You should use fmt.Sprintf it looks more redable than just +</p></pre>
这是一个分享于 的资源,其中的信息可能已经有所发展或是发生改变。
入群交流(和以上内容无关):加入Go大咖交流群,或添加微信:liuxiaoyan-s 备注:入群;或加QQ群:692541889
- 请尽量让自己的回复能够对别人有帮助
- 支持 Markdown 格式, **粗体**、~~删除线~~、
`单行代码`
- 支持 @ 本站用户;支持表情(输入 : 提示),见 Emoji cheat sheet
- 图片支持拖拽、截图粘贴等方式上传