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

fastcache doesn't store value with length of exactly 512k #60

Open
AlexBlack772 opened this issue Oct 24, 2021 · 0 comments
Open

fastcache doesn't store value with length of exactly 512k #60

AlexBlack772 opened this issue Oct 24, 2021 · 0 comments

Comments

@AlexBlack772
Copy link

I've faced with an issue that fastcache doesn't store value with length of exactly 512k

func main() {
	cache := fastcache.New(1024)

	var key, val []byte

	key = []byte("k")
	val = make([]byte, 512000)

	cache.SetBig(key, val)
	val = cache.GetBig(nil, key)

	if val == nil {
		fmt.Println("Value is missing")
	} else {
		fmt.Println("Value is OK")
		fmt.Println(len(val))
	}
}

The code prints "Value is missing", but if I create val as make([]byte, 512000+1) then I can set and get value.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant