Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- func GenID() {
- type bondChaincode struct {
- YYMM string
- Count int
- }
- yymm := time.Now().Format("0602")
- bondCC := bondChaincode{}
- bondCC.YYMM = yymm
- bondCC.Count = bondCC.Count + 1
- iStr := strconv.Itoa(bondCC.Count)
- for len(iStr) < 6 {
- iStr = "0" + iStr
- }
- // format YYMMxxxxxx
- fmt.Println(yymm + iStr)
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement