pgtype icon indicating copy to clipboard operation
pgtype copied to clipboard

Implement Stringer interface

Open timsolov opened this issue 5 years ago • 1 comments

Why structs don't implement Stringer interface ? It would be nice to have .String() string method for easy use in fmt.Println and in logger.

timsolov avatar Jul 22 '20 06:07 timsolov

I'm not opposed to it. It just hasn't been done. If it was to be done it probably would make sense to implement it via EncodeText so that the PostgreSQL text representation of the value is used. It also may make sense to abbreviate long values like bytea.

jackc avatar Jul 22 '20 11:07 jackc