Skip to content

*: use new slice to array conversion syntax #118800

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

Merged
merged 1 commit into from
Feb 8, 2024

Conversation

nvanbenschoten
Copy link
Contributor

Closes #110261.

This commit adopts the new slice to array conversion syntax introduced in go 1.20. The new syntax is only applicable in one small part of the codebase, so it's a small change.

From https://tip.golang.org/doc/go1.20:

Go 1.20 extends this to allow conversions from a slice to an array: given a slice x, [4]byte(x) can now be written instead of ([4]byte)(x).

Release note: None

@nvanbenschoten nvanbenschoten requested review from rickystewart, a team and abarganier and removed request for a team February 6, 2024 00:05
Copy link

blathers-crl bot commented Feb 6, 2024

It looks like your PR touches production code but doesn't add or edit any test code. Did you consider adding tests to your PR?

🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is dev-inf.

@cockroach-teamcity
Copy link
Member

This change is Reviewable

@@ -949,8 +949,8 @@ func SpanMetaFromProto(info tracingpb.TraceInfo) SpanMeta {
// NOTE: The ugly starry expressions below can be simplified once/if direct
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: Comment should be deleted, no?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤦 thanks. Done.

Closes cockroachdb#110261.

This commit adopts the new slice to array conversion syntax introduced
in go 1.20. The new syntax is only applicable in one small part of the
codebase, so it's a small change.

From https://tip.golang.org/doc/go1.20:

> Go 1.20 extends this to allow conversions from a slice to an array:
> given a slice x, [4]byte(x) can now be written instead of
> *(*[4]byte)(x).

Release note: None
@nvanbenschoten nvanbenschoten force-pushed the nvanbenschoten/arrayConv branch from 28c104c to 3116fdf Compare February 7, 2024 17:26
@nvanbenschoten
Copy link
Contributor Author

TFTR!

bors r+

@craig
Copy link
Contributor

craig bot commented Feb 8, 2024

Build succeeded:

@craig craig bot merged commit a60fc9a into cockroachdb:master Feb 8, 2024
@nvanbenschoten nvanbenschoten deleted the nvanbenschoten/arrayConv branch February 8, 2024 19:22
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 this pull request may close these issues.

*: use new slice to array conversion syntax
3 participants