1、Go 语言的 if 语句允许在条件之前传递一个语句。
原始代码:
f, contains := factory[string(token)] if contains { // Do something }
优化:(稍微提高了代码的可读性)
if f, contains := factory[sToken]; contains { // Do something }
标签:Do,contains,factory,代码优化,something,Go From: https://www.cnblogs.com/beatle-go/p/17865337.html