forked from golang/hotime
19 lines
247 B
Go
19 lines
247 B
Go
|
package common
|
||
|
|
||
|
import (
|
||
|
"time"
|
||
|
)
|
||
|
|
||
|
type ContextBase struct {
|
||
|
tag string
|
||
|
}
|
||
|
|
||
|
//唯一标志
|
||
|
func (that *ContextBase) GetTag() string {
|
||
|
|
||
|
if that.tag == "" {
|
||
|
that.tag = ObjToStr(time.Now().Unix()) + ":" + ObjToStr(Random())
|
||
|
}
|
||
|
return that.tag
|
||
|
}
|