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(u[:], bytes) | ||
|
|
||
| return nil | ||
| } |
There was a problem hiding this comment.
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.
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.
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.
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://togithub.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://togithub.com/microsoft/go-mssqldb/releases/tag/v1.5.0) [Compare Source](https://togithub.com/microsoft/go-mssqldb/compare/v1.4.0...v1.5.0) #### What's Changed - go mod vendor npipe to this repo by [@​shueybubbles](https://togithub.com/shueybubbles) in [https://github.com/microsoft/go-mssqldb/pull/118](https://togithub.com/microsoft/go-mssqldb/pull/118) - Enable dependabot for pkg updates by [@​apoorvdeshmukh](https://togithub.com/apoorvdeshmukh) in [https://github.com/microsoft/go-mssqldb/pull/119](https://togithub.com/microsoft/go-mssqldb/pull/119) - fix: mips and mipsel builds by [@​powersj](https://togithub.com/powersj) in [https://github.com/microsoft/go-mssqldb/pull/124](https://togithub.com/microsoft/go-mssqldb/pull/124) - Allow for local dns resolution with a custom dialer by [@​stephaniehingtgen](https://togithub.com/stephaniehingtgen) in [https://github.com/microsoft/go-mssqldb/pull/121](https://togithub.com/microsoft/go-mssqldb/pull/121) - Fixes MarshalText and adds UnmarshalJSON interface for UniqueIdentifier by [@​Musab-Nazir](https://togithub.com/Musab-Nazir) in [https://github.com/microsoft/go-mssqldb/pull/126](https://togithub.com/microsoft/go-mssqldb/pull/126) - Update README.md by [@​dlevy-msft](https://togithub.com/dlevy-msft) in [https://github.com/microsoft/go-mssqldb/pull/132](https://togithub.com/microsoft/go-mssqldb/pull/132) - Fix: Handle extended chars in SQL instance names by [@​shueybubbles](https://togithub.com/shueybubbles) in [https://github.com/microsoft/go-mssqldb/pull/138](https://togithub.com/microsoft/go-mssqldb/pull/138) #### New Contributors - [@​powersj](https://togithub.com/powersj) made their first contribution in [https://github.com/microsoft/go-mssqldb/pull/124](https://togithub.com/microsoft/go-mssqldb/pull/124) - [@​stephaniehingtgen](https://togithub.com/stephaniehingtgen) made their first contribution in [https://github.com/microsoft/go-mssqldb/pull/121](https://togithub.com/microsoft/go-mssqldb/pull/121) - [@​Musab-Nazir](https://togithub.com/Musab-Nazir) made their first contribution in [https://github.com/microsoft/go-mssqldb/pull/126](https://togithub.com/microsoft/go-mssqldb/pull/126) - [@​dlevy-msft](https://togithub.com/dlevy-msft) made their first contribution in [https://github.com/microsoft/go-mssqldb/pull/132](https://togithub.com/microsoft/go-mssqldb/pull/132) **Full Changelog**: microsoft/go-mssqldb@v1.1.0...v1.5.0 ### [`v1.4.0`](https://togithub.com/microsoft/go-mssqldb/compare/v1.3.0...v1.4.0) [Compare Source](https://togithub.com/microsoft/go-mssqldb/compare/v1.3.0...v1.4.0) ### [`v1.3.0`](https://togithub.com/microsoft/go-mssqldb/compare/v1.2.0...v1.3.0) [Compare Source](https://togithub.com/microsoft/go-mssqldb/compare/v1.2.0...v1.3.0) ### [`v1.2.0`](https://togithub.com/microsoft/go-mssqldb/compare/v1.1.0...v1.2.0) [Compare Source](https://togithub.com/microsoft/go-mssqldb/compare/v1.1.0...v1.2.0) ### [`v1.1.0`](https://togithub.com/microsoft/go-mssqldb/releases/tag/v1.1.0) [Compare Source](https://togithub.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://togithub.com/microsoft/go-mssqldb/issues/110)) - Updated go package dependencies ([#​112](https://togithub.com/microsoft/go-mssqldb/issues/112)) ### [`v1.0.0`](https://togithub.com/microsoft/go-mssqldb/compare/v0.21.0...v1.0.0) [Compare Source](https://togithub.com/microsoft/go-mssqldb/compare/v0.21.0...v1.0.0) ### [`v0.21.0`](https://togithub.com/microsoft/go-mssqldb/compare/v0.20.0...v0.21.0) [Compare Source](https://togithub.com/microsoft/go-mssqldb/compare/v0.20.0...v0.21.0) ### [`v0.20.0`](https://togithub.com/microsoft/go-mssqldb/compare/v0.19.0...v0.20.0) [Compare Source](https://togithub.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://togithub.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNi41NC4yIiwidXBkYXRlZEluVmVyIjoiMzYuNTQuMiIsInRhcmdldEJyYW5jaCI6Im1haW4ifQ==-->
Addresses #92