// 2022年第一天
day := time.Date(2022, 1, 1, 0, 0, 0, 0, time.Local)
// 2022年的第304天
days := 304
// 2022年第304天的日期
expectedDay := day.Add(time.Duration(days*24*3600) * time.Second)
// 这一天是星期几
fmt.Println(expectedDay.Weekday())
// 这一天的日期
fmt.Println(expectedDay.Date())
设置时间间隔为5秒 如果get不到就断开连接,post方法类似 都在client里设置http的超时时间timeout := time.Duration(5 * time.Second)
client := http.Client{
Timeout: timeout,}
client.Get(url)