1234567891011121314151617181920212223242526272829303132333435363738394041 |
- package main
- import (
- "fmt"
- "strconv"
- "testing"
- "time"
- )
- func TestMonth(T *testing.T) {
- // 创建2023年12月31日的时间对象
- date := time.Date(2023, time.August, 30, 0, 0, 0, 0, time.UTC)
- next := date.AddDate(0, -1, -1)
- month := int(next.Month())
- monthStr := strconv.Itoa(month)
- year := next.Year()
- yearStr := strconv.Itoa(year)
- //预处理索引名称
- PreBiddingIndex := "bidding_" + yearStr + monthStr
- fmt.Sprintf(PreBiddingIndex)
- }
- func TestDeleteIndex(t *testing.T) {
- data := map[string]string{
- "aa": "aaa",
- "bb": "bbb",
- "cc": "ccc",
- }
- for _, v := range data {
- if v == "aaa" {
- return
- }
- fmt.Println(v)
- }
- }
|