Skip to content

GetObject result.ContentLength different from Response Content #2525

Answered by RanVaknin
gautampunhani asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @gautampunhani,

Thanks for reaching out.
I don't think this has anything to do with #2370.

response.ContentLength is a *int64.
In your code you are printing the pointer of content length:

fmt.Printf("\n\nContent Length %d", out.ContentLength)

Instead, you need to dereference it:

fmt.Printf("\n\nContent Length %d", *out.ContentLength)

Thanks,
Ran~

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@gautampunhani
Comment options

Answer selected by lucix-aws
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #2524 on March 01, 2024 23:22.