开发者

checking if array[key] isset? throw: index out of range

开发者 https://www.devze.com 2022-12-12 00:41 出处:网络
if i try to access key in 开发者_如何学JAVAarray which does not exist i get throw: index out of range with a stacktrace.

if i try to access key in 开发者_如何学JAVAarray which does not exist i get throw: index out of range with a stacktrace.

How do i check if tmp[key] "is set" ?


This accualy works:

if len(url) > 1 {
    tmp := strings.Split(url[1],"=",0);
    if len(tmp) >1{
        sess = tmp[1];
    }
}
0

精彩评论

暂无评论...
验证码 换一张
取 消