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

support text scanner for binary format for uint32 #2112

Merged
merged 4 commits into from
Aug 23, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
update struct name
  • Loading branch information
jennifersp committed Aug 22, 2024
commit 57fd684068b6032108554dad43b9611dd4149ed0
6 changes: 3 additions & 3 deletions pgtype/uint32.go
Original file line number Diff line number Diff line change
@@ -206,7 +206,7 @@ func (Uint32Codec) PlanScan(m *Map, oid uint32, format int16, target any) ScanPl
case Uint32Scanner:
return scanPlanBinaryUint32ToUint32Scanner{}
case TextScanner:
return scanPlanBinaryTextToUint32Scanner{}
return scanPlanBinaryUint32ToTextScanner{}
}
case TextFormatCode:
switch target.(type) {
@@ -284,9 +284,9 @@ func (scanPlanBinaryUint32ToUint32Scanner) Scan(src []byte, dst any) error {
return s.ScanUint32(Uint32{Uint32: n, Valid: true})
}

type scanPlanBinaryTextToUint32Scanner struct{}
type scanPlanBinaryUint32ToTextScanner struct{}

func (scanPlanBinaryTextToUint32Scanner) Scan(src []byte, dst any) error {
func (scanPlanBinaryUint32ToTextScanner) Scan(src []byte, dst any) error {
s, ok := (dst).(TextScanner)
if !ok {
return ErrScanTargetTypeChanged