Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如果我尝试访问不存在的数组中的键,我会抛出:使用堆栈跟踪的索引超出范围。
如何检查 tmp[key] 是否“已设置”?
这准确有效:
if len(url) > 1 { tmp := strings.Split(url[1],"=",0); if len(tmp) >1{ sess = tmp[1]; } }