即cmap参数的字符串值
https://matplotlib.org/stable/tutorials/colors/colormaps.html[......]
time.Parse(layout, "2023-03-04")
其中layout用类似"2006-01-02 15:04:05"这样的字符串做模板,这个对开发者太友好了,再也不用yyyy记忆了,一些内置的如下:
const (
ANSIC = "Mon Jan _2 15:04:05 2006"
UnixDate = "Mon Jan _2 15:04:05 MST 2006"
RubyDate = "Mon Jan 02 15:04:[......]
最土的办法,就是模拟:
func calc_work_day(begin, end time.Time) int {
var workDay = 0
var curTime = begin
for {
if curTime.After(end) {
break
}
if curTime.Weekday() == time.Saturday || curTime.Weekday() == time.Sunday {
//[......]
1 发送get请求
func http_get(url string) string {
resp, err := http.Get(url)
if err != nil {
fmt.Println(err)
return ""
}
defer resp.Body.Close()
body, err := ioutil.ReadAll(resp.Body)
// resp.StatusCode
return string(body)[......]
https://www.infoq.cn/article/fjebconxd2sz9wloykfo[......]