本文整理汇总了Golang中github.com/v2ray/v2ray-core/common/serial.String类的典型用法代码示例。如果您正苦于以下问题:Golang String类的具体用法?Golang String怎么用?Golang String使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了String类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: Get
func (this *ValidityMap) Get(key serial.String) Validity {
this.RLock()
defer this.RUnlock()
if value, found := this.cache[key.String()]; found {
return value
}
return nil
}
示例2: Set
func (this *ValidityMap) Set(key serial.String, value Validity) {
this.Lock()
this.cache[key.String()] = value
this.Unlock()
opCount := atomic.AddInt32(&this.opCount, 1)
if opCount > 1000 {
atomic.StoreInt32(&this.opCount, 0)
go this.cleanup()
}
}
示例3: Fail
func (subject *Subject) Fail(displayString string, verb string, other serial.String) {
subject.FailWithMessage("Not true that " + displayString + " " + verb + " <" + other.String() + ">.")
}
示例4: Log
func (this *stdOutLogWriter) Log(log serial.String) {
this.logger.Print(log.String() + platform.LineSeparator())
}
示例5: Set
func (this *ValidityMap) Set(key serial.String, value Validity) {
this.Lock()
this.cache[key.String()] = value
this.Unlock()
}
示例6: NotContains
func (subject *StringSubject) NotContains(substring serial.String) {
if strings.Contains(subject.value.String(), substring.String()) {
subject.Fail(subject.DisplayString(), "doesn't contain", substring)
}
}
示例7: Contains
func (subject *StringSubject) Contains(substring serial.String) {
if !strings.Contains(subject.value.String(), substring.String()) {
subject.Fail(subject.DisplayString(), "contains", substring)
}
}