-
Notifications
You must be signed in to change notification settings - Fork 71
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
Fixes MarshalText and adds UnmarshalJSON interface for UniqueIdentifier #126
Fixes MarshalText and adds UnmarshalJSON interface for UniqueIdentifier #126
Conversation
- The existing MarshalText() for the UniqueIdentifier type had a bad signature. It omitted returning an error that the interface expects. - Added UnmarshalJSON() interface to the UniqueIdentifier type with a test as well
@microsoft-github-policy-service agree |
thx for contributing a PR! |
// Copy the bytes to the UniqueIdentifier | ||
copy(u[:], bytes) | ||
|
||
return nil | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can this be moved to a uniqueidentifier_go112.go? Otherwise you need an older API than strings.ReplaceAll
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just to make sure I'm on the same page, you mean I should move the newly added code to a new file called uniqueidentifier_go112.go
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Assuming that this new interface is only needed for apps using a Go version newer than 1.11, then yes.
If you think apps using older Go versions need this implementation, you'll need to fix the build.
Currently 1.10 and 1.11 builds fail.
go build
# github.com/microsoft/go-mssqldb
.\uniqueidentifier.go:91:33: undefined: strings.ReplaceAll
Command exited with code 2
At some point we will upgrade the minimum supported go version for this driver.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah I see.
I've switched over to using strings.Replace
instead and I see now that the go 1.10 and 1.11 build versions are passing
This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [github.com/microsoft/go-mssqldb](https://github.com/microsoft/go-mssqldb) | require | major | `v0.19.0` -> `v1.5.0` | --- ### ⚠ Dependency Lookup Warnings ⚠ Warnings were logged while processing this repo. Please check the Dependency Dashboard for more information. --- ### Release Notes <details> <summary>microsoft/go-mssqldb (github.com/microsoft/go-mssqldb)</summary> ### [`v1.5.0`](https://github.com/microsoft/go-mssqldb/releases/tag/v1.5.0) [Compare Source](https://github.com/microsoft/go-mssqldb/compare/v1.4.0...v1.5.0) #### What's Changed - go mod vendor npipe to this repo by [@​shueybubbles](https://github.com/shueybubbles) in [https://github.com/microsoft/go-mssqldb/pull/118](https://github.com/microsoft/go-mssqldb/pull/118) - Enable dependabot for pkg updates by [@​apoorvdeshmukh](https://github.com/apoorvdeshmukh) in [https://github.com/microsoft/go-mssqldb/pull/119](https://github.com/microsoft/go-mssqldb/pull/119) - fix: mips and mipsel builds by [@​powersj](https://github.com/powersj) in [https://github.com/microsoft/go-mssqldb/pull/124](https://github.com/microsoft/go-mssqldb/pull/124) - Allow for local dns resolution with a custom dialer by [@​stephaniehingtgen](https://github.com/stephaniehingtgen) in [https://github.com/microsoft/go-mssqldb/pull/121](https://github.com/microsoft/go-mssqldb/pull/121) - Fixes MarshalText and adds UnmarshalJSON interface for UniqueIdentifier by [@​Musab-Nazir](https://github.com/Musab-Nazir) in [https://github.com/microsoft/go-mssqldb/pull/126](https://github.com/microsoft/go-mssqldb/pull/126) - Update README.md by [@​dlevy-msft](https://github.com/dlevy-msft) in [https://github.com/microsoft/go-mssqldb/pull/132](https://github.com/microsoft/go-mssqldb/pull/132) - Fix: Handle extended chars in SQL instance names by [@​shueybubbles](https://github.com/shueybubbles) in [https://github.com/microsoft/go-mssqldb/pull/138](https://github.com/microsoft/go-mssqldb/pull/138) #### New Contributors - [@​powersj](https://github.com/powersj) made their first contribution in [https://github.com/microsoft/go-mssqldb/pull/124](https://github.com/microsoft/go-mssqldb/pull/124) - [@​stephaniehingtgen](https://github.com/stephaniehingtgen) made their first contribution in [https://github.com/microsoft/go-mssqldb/pull/121](https://github.com/microsoft/go-mssqldb/pull/121) - [@​Musab-Nazir](https://github.com/Musab-Nazir) made their first contribution in [https://github.com/microsoft/go-mssqldb/pull/126](https://github.com/microsoft/go-mssqldb/pull/126) - [@​dlevy-msft](https://github.com/dlevy-msft) made their first contribution in [https://github.com/microsoft/go-mssqldb/pull/132](https://github.com/microsoft/go-mssqldb/pull/132) **Full Changelog**: microsoft/go-mssqldb@v1.1.0...v1.5.0 ### [`v1.4.0`](https://github.com/microsoft/go-mssqldb/compare/v1.3.0...v1.4.0) [Compare Source](https://github.com/microsoft/go-mssqldb/compare/v1.3.0...v1.4.0) ### [`v1.3.0`](https://github.com/microsoft/go-mssqldb/compare/v1.2.0...v1.3.0) [Compare Source](https://github.com/microsoft/go-mssqldb/compare/v1.2.0...v1.3.0) ### [`v1.2.0`](https://github.com/microsoft/go-mssqldb/compare/v1.1.0...v1.2.0) [Compare Source](https://github.com/microsoft/go-mssqldb/compare/v1.1.0...v1.2.0) ### [`v1.1.0`](https://github.com/microsoft/go-mssqldb/releases/tag/v1.1.0) [Compare Source](https://github.com/microsoft/go-mssqldb/compare/v1.0.0...v1.1.0) ### Version 1.1.0 - Release date: May 30, 2023 #### What's new in 1.1.0 - Supports finding the DAC port using the browser service ([#​110](https://github.com/microsoft/go-mssqldb/issues/110)) - Updated go package dependencies ([#​112](https://github.com/microsoft/go-mssqldb/issues/112)) ### [`v1.0.0`](https://github.com/microsoft/go-mssqldb/compare/v0.21.0...v1.0.0) [Compare Source](https://github.com/microsoft/go-mssqldb/compare/v0.21.0...v1.0.0) ### [`v0.21.0`](https://github.com/microsoft/go-mssqldb/compare/v0.20.0...v0.21.0) [Compare Source](https://github.com/microsoft/go-mssqldb/compare/v0.20.0...v0.21.0) ### [`v0.20.0`](https://github.com/microsoft/go-mssqldb/compare/v0.19.0...v0.20.0) [Compare Source](https://github.com/microsoft/go-mssqldb/compare/v0.19.0...v0.20.0) </details> --- ### Configuration 📅 **Schedule**: Branch creation - "before 4am on the first day of the month" (UTC), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNi41NC4yIiwidXBkYXRlZEluVmVyIjoiMzYuNTQuMiIsInRhcmdldEJyYW5jaCI6Im1haW4ifQ==-->
Addresses #92