pre_test.go 656 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. package main
  2. import (
  3. "fmt"
  4. "strconv"
  5. "testing"
  6. "time"
  7. )
  8. func TestMonth(T *testing.T) {
  9. // 创建2023年12月31日的时间对象
  10. date := time.Date(2023, time.August, 30, 0, 0, 0, 0, time.UTC)
  11. next := date.AddDate(0, -1, -1)
  12. month := int(next.Month())
  13. monthStr := strconv.Itoa(month)
  14. year := next.Year()
  15. yearStr := strconv.Itoa(year)
  16. //预处理索引名称
  17. PreBiddingIndex := "bidding_" + yearStr + monthStr
  18. fmt.Sprintf(PreBiddingIndex)
  19. }
  20. func TestDeleteIndex(t *testing.T) {
  21. data := map[string]string{
  22. "aa": "aaa",
  23. "bb": "bbb",
  24. "cc": "ccc",
  25. }
  26. for _, v := range data {
  27. if v == "aaa" {
  28. return
  29. }
  30. fmt.Println(v)
  31. }
  32. }