소스 검색

修复随机数的问题

Spedoske 5 년 전
부모
커밋
51aaa16d79
2개의 변경된 파일4개의 추가작업 그리고 0개의 파일을 삭제
  1. 3 0
      .goreleaser.yml
  2. 1 0
      util.go

+ 3 - 0
.goreleaser.yml

@@ -27,8 +27,11 @@ archives:
     darwin: MacOS
     linux: Linux
     windows: Windows
+    freebsd: Freebsd
     386: x86
     amd64: x64
+  files:
+    - ip.txt
 checksum:
   name_template: 'checksums.txt'
 snapshot:

+ 1 - 0
util.go

@@ -89,6 +89,7 @@ const failTime = 4
 type CloudflareIPDataSet []CloudflareIPData
 
 func initipEndWith() {
+    rand.Seed(time.Now().UnixNano())
 	ipEndWith = uint8(rand.Intn(254) + 1)
 }