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

Implement Stringer interface for pool.Role #405

Closed
KaymeKaydex opened this issue Sep 4, 2024 · 1 comment · Fixed by #406
Closed

Implement Stringer interface for pool.Role #405

KaymeKaydex opened this issue Sep 4, 2024 · 1 comment · Fixed by #406

Comments

@KaymeKaydex
Copy link

KaymeKaydex commented Sep 4, 2024

The problem is that now when logging via %v the role status is displayed as a number
sucessfully connected to pool; map[mydb1:{true 1} mydb2:{true 2}]

For backward compatibility, I suggest making a String() method with selection by switch case

type Role uint32

@KaymeKaydex KaymeKaydex changed the title Add Stringify interface for pool.Role Add Stringer interface for pool.Role Sep 4, 2024
@KaymeKaydex KaymeKaydex changed the title Add Stringer interface for pool.Role Implement Stringer interface for pool.Role Sep 4, 2024
@KaymeKaydex
Copy link
Author

KaymeKaydex commented Sep 4, 2024

or should I just use type string instead of uint? This information is mainly used for logs, so including the format in json will then work more informatively

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 a pull request may close this issue.

1 participant