Skip to content

Instantly share code, notes, and snippets.

View WonderfulSoap's full-sized avatar

WonderfulSoap WonderfulSoap

View GitHub Profile
long_string = "This is a very long string!"
# 将多个if判断转化为数组,keys中多个元素为and关系
conditions = [
{"keys": ["Andy"], "result": "string1"},
{"keys": ["Jack"], "result": "string2"},
{"keys": ["Jim","Mike"], "result": "string3"},
]
def find_result():
@WonderfulSoap
WonderfulSoap / 1.target.go
Last active March 22, 2022 05:39
some generics function unit test examples
package main
import (
"reflect"
"testing"
)
type addAble interface {
~int | ~int8 | ~int16 | ~int32 | ~int64 | ~uint | ~uint8 | ~uint16 | ~uint32 | ~uint64 | ~float64 | ~float32 | ~string
}