Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MustGet("key").Int()异常 #27

Closed
luomoxu opened this issue Sep 25, 2023 · 3 comments
Closed

MustGet("key").Int()异常 #27

luomoxu opened this issue Sep 25, 2023 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@luomoxu
Copy link

luomoxu commented Sep 25, 2023

package main

import (
	"fmt"
	jsonvalue "github.com/Andrew-M-C/go.jsonvalue"
)

func main() {
	raw := `{"number":""}`
	n := jsonvalue.MustUnmarshalString(raw)
	fmt.Println(n.MustGet("number").Int())
}

执行会报错
panic: runtime error: index out of range [0] with length 0

这个是设计就是如此还是非预期错误?

@Andrew-M-C Andrew-M-C added the bug Something isn't working label Sep 26, 2023
@Andrew-M-C Andrew-M-C self-assigned this Sep 26, 2023
@Andrew-M-C
Copy link
Owner

呀这肯定是错误了,我处理下~~

Andrew-M-C added a commit that referenced this issue Sep 26, 2023
@Andrew-M-C
Copy link
Owner

@luomoxu
您可以试一下
go get github.com/Andrew-M-C/go.jsonvalue@feature/v1.3.6
或者
go get github.com/Andrew-M-C/go.jsonvalue@b9b1257

这个分支修复了俩 bug,过段时间没有新 bug 的话我就打 tag

@Andrew-M-C
Copy link
Owner

Fixed at Tag v1.3.6

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants