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

Fix typo in the readme #767

Merged
merged 4 commits into from
Aug 2, 2017
Merged

Fix typo in the readme #767

merged 4 commits into from
Aug 2, 2017

Conversation

fetmar
Copy link
Contributor

@fetmar fetmar commented Jul 20, 2017

Changed Println with formatting to a Printf

@deekoder
Copy link
Contributor

@fetmar why do you suggest we change Println to Printf ? Is the output looking better in the latter?

@fetmar
Copy link
Contributor Author

fetmar commented Jul 20, 2017

It's failing in travis but I'm not sure why since I didn't change anything but the readme.

Fails here:

The command "SERVER_ENDPOINT=play.minio.io:9000 ACCESS_KEY=Q3AM3UQ867SPQQA43P2F SECRET_KEY=zuf+tfteSlswRu7BJ86wekitnifILbZam1KYY3TG ENABLE_HTTPS=1 go run functional_tests.go" exited with 2.

@fetmar
Copy link
Contributor Author

fetmar commented Jul 20, 2017

@deekoder Just because the original line there says %v, which is a formatting string. Println doesn't accept formatting strings, only things like Sprintf and Printf. Println is by default %v. So the way this is written, it's basically just as good as saying Println(minioClient).

Actually, I like that better. I'll remove the formatting string altogether. :)

@fetmar
Copy link
Contributor Author

fetmar commented Jul 21, 2017

On second thought...

Println(minioClient)

&{{http  <nil> 192.168.99.100:30199   false  } 0xc420122240 0 { } false 0xc42011c7e0 0xc42010c4c0 true 0xc42000c018   0xc42011c840}

Printf("%+v\n", minioClient)

&{endpointURL:{Scheme:http Opaque: User:<nil> Host:192.168.99.100:30199 Path: RawPath: ForceQuery:false RawQuery: Fragment:} credsProvider:0xc420122240 overrideSignerType:0 appInfo:{appName: appVersion:} secure:false httpClient:0xc42011c7e0 bucketLocCache:0xc42010c4c0 isTraceEnabled:true traceOutput:0xc42000c018 s3AccelerateEndpoint: region: random:0xc42011c840}

Printf("%#v\n", minioClient)

&minio.Client{endpointURL:url.URL{Scheme:"http", Opaque:"", User:(*url.Userinfo)(nil), Host:"192.168.99.100:30199", Path:"", RawPath:"", ForceQuery:false, RawQuery:"", Fragment:""}, credsProvider:(*credentials.Credentials)(0xc420122240), overrideSignerType:0, appInfo:struct { appName string; appVersion string }{appName:"", appVersion:""}, secure:false, httpClient:(*http.Client)(0xc42011c7e0), bucketLocCache:(*minio.bucketLocationCache)(0xc42010c4a0), isTraceEnabled:true, traceOutput:(*os.File)(0xc42000c018), s3AccelerateEndpoint:"", region:"", random:(*rand.Rand)(0xc42011c840)}

I prefer the last option. It's the prettiest of the prints that's a part of go's standard library. 🌹

Copy link
Member

@harshavardhana harshavardhana left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Okay to use Printf() to print the variables in the Go fashion.

@harshavardhana
Copy link
Member

// cc @deekoder we can take this in if you don't have further questions?

@harshavardhana
Copy link
Member

// cc @deekoder if you don't have any further questions we can take this in.

@deekoder deekoder merged commit d2e3c5c into minio:master Aug 2, 2017
@deekoder
Copy link
Contributor

deekoder commented Aug 2, 2017

Sorry for the delay. Merging now.

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

Successfully merging this pull request may close these issues.

3 participants