當前位置: 首頁>>代碼示例>>Golang>>正文


Golang serial.String類代碼示例

本文整理匯總了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
}
開發者ID:ducktsmt,項目名稱:v2ray-core,代碼行數:8,代碼來源:validity_map.go

示例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()
	}
}
開發者ID:earthGavinLee,項目名稱:v2ray-core,代碼行數:10,代碼來源:validity_map.go

示例3: Fail

func (subject *Subject) Fail(displayString string, verb string, other serial.String) {
	subject.FailWithMessage("Not true that " + displayString + " " + verb + " <" + other.String() + ">.")
}
開發者ID:ducktsmt,項目名稱:v2ray-core,代碼行數:3,代碼來源:subject.go

示例4: Log

func (this *stdOutLogWriter) Log(log serial.String) {
	this.logger.Print(log.String() + platform.LineSeparator())
}
開發者ID:ducktsmt,項目名稱:v2ray-core,代碼行數:3,代碼來源:log_writer.go

示例5: Set

func (this *ValidityMap) Set(key serial.String, value Validity) {
	this.Lock()
	this.cache[key.String()] = value
	this.Unlock()
}
開發者ID:ducktsmt,項目名稱:v2ray-core,代碼行數:5,代碼來源:validity_map.go

示例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)
	}
}
開發者ID:ducktsmt,項目名稱:v2ray-core,代碼行數:5,代碼來源:stringsubject.go

示例7: Contains

func (subject *StringSubject) Contains(substring serial.String) {
	if !strings.Contains(subject.value.String(), substring.String()) {
		subject.Fail(subject.DisplayString(), "contains", substring)
	}
}
開發者ID:ducktsmt,項目名稱:v2ray-core,代碼行數:5,代碼來源:stringsubject.go


注:本文中的github.com/v2ray/v2ray-core/common/serial.String類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。