本文整理匯總了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)
}
}