Skip to content

Commit a8df49f

Browse files
committed
生成00~FF
1 parent 573df75 commit a8df49f

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

kafka/kafka_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ func Test_Producer(t *testing.T) {
3636
case err := <-AsyncProducer.Errors():
3737
fmt.Println("AsyncProducer.Errors()", err.Error())
3838
}
39-
}
39+
, ,, }
4040
}()
4141
for {
4242
Message := &sarama.ProducerMessage{

other/00_ff_test.go

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
package main
2+
3+
import (
4+
"fmt"
5+
"math/rand"
6+
"testing"
7+
"time"
8+
)
9+
10+
//可以作为 hbase rowkey 前置补0
11+
func TestFF(t *testing.T) {
12+
rand.Seed(time.Now().Unix())
13+
for i := 1; i <= 256; i++ {
14+
a := fmt.Sprintf("%02x", rand.Intn(256))
15+
t.Log(a)
16+
}
17+
}

0 commit comments

Comments
 (0)