Skip to content

Move pointer types into the code model - #5430

Merged
Joel Hendrix (jhendrixMSFT) merged 2 commits into
Azure:mainfrom
jhendrixMSFT:go-ptr
Sep 10, 2026
Merged

Move pointer types into the code model#5430
Joel Hendrix (jhendrixMSFT) merged 2 commits into
Azure:mainfrom
jhendrixMSFT:go-ptr

Conversation

@jhendrixMSFT

Copy link
Copy Markdown
Member

Added Ptr to the code model allowing pointer-to-type to be explicitly modeled. This replaces "byValue" fields on various code model types. This also codifies the rules about what's actually emitted as pointer-to-type, e.g. maps/slices are never pointer-to-type which is now accurately reflected in the code model.
In addition, emitting a "*" or "&" prefix on a type is now centralized instead of being spread all over with a few duplicate implementations.

No functional changes.

Added Ptr<T> to the code model allowing pointer-to-type to be explicitly
modeled.  This replaces "byValue" fields on various code model types.
This also codifies the rules about what's actually emitted as
pointer-to-type, e.g. maps/slices are never pointer-to-type which is now
accurately reflected in the code model.
In addition, emitting a "*" or "&" prefix on a type is now centralized
instead of being spread all over with a few duplicate implementations.
@github-actions

github-actions Bot commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

All changed packages have been documented.

  • @azure-tools/typespec-go
Show changes

@azure-tools/typespec-go - internal ✏️

Add Ptr to the code model to explicitly model pointer types.

@github-actions

github-actions Bot commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

📦 Package size report

1 package changed size, +2.43 KB (+0.0%) packed overall.

Package Packed (base → head) Δ Packed Unpacked (base → head) Δ Unpacked
@azure-tools/typespec-go 261.39 KB → 263.90 KB +2.51 KB (+1.0%) 🔴 1.34 MB → 1.35 MB +11.04 KB (+0.8%) 🔴
12 package(s) with no notable change
Package Packed (base → head) Δ Packed Unpacked (base → head) Δ Unpacked
@azure-tools/typespec-java 13.51 MB → 13.51 MB -79 B (-0.0%) 15.04 MB → 15.04 MB
@azure-tools/azure-http-specs 146.77 KB → 146.77 KB 1.16 MB → 1.16 MB
@azure-tools/typespec-autorest 81.23 KB → 81.23 KB 396.61 KB → 396.61 KB
@azure-tools/typespec-autorest-canonical 7.42 KB → 7.42 KB 26.00 KB → 26.00 KB
@azure-tools/typespec-azure-core 130.84 KB → 130.84 KB 709.83 KB → 709.83 KB
@azure-tools/typespec-azure-portal-core 42.47 KB → 42.47 KB 193.15 KB → 193.15 KB
@azure-tools/typespec-azure-resource-manager 177.31 KB → 177.31 KB 1.07 MB → 1.07 MB
@azure-tools/typespec-azure-rulesets 5.25 KB → 5.25 KB 32.49 KB → 32.49 KB
@azure-tools/typespec-client-generator-core 237.09 KB → 237.09 KB 1.27 MB → 1.27 MB
@azure-tools/typespec-metadata 15.91 KB → 15.91 KB 62.26 KB → 62.26 KB
@azure-tools/typespec-python 42.22 KB → 42.22 KB 164.91 KB → 164.91 KB
@azure-tools/typespec-ts 540.59 KB → 540.59 KB 2.60 MB → 2.60 MB

Packed = gzipped .tgz published to npm. Unpacked = total extracted size. 🆕 added, 🗑️ removed. Packages from the core/ submodule are not included.
🔴 grew · 🟢 shrank — only changes of at least 512 B and 0.5% are marked.

@github-actions

github-actions Bot commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

Go emitter diff

Baseline gh:cc2dffa276b1066a9d08e415181b64b3d6c5e9aa vs this PR.

No changes to generated output.

Rendered diff: inline on the run summary, or the emitter-diff-go-html artifact.

Informational check (core/eng/emitter-diff); does not block the PR.

@pkg-pr-new

pkg-pr-new Bot commented Sep 8, 2026

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/@azure-tools/typespec-go@5430

commit: 8a26f64

@azure-sdk-automation

Copy link
Copy Markdown
Contributor

You can try these changes here

🛝 Playground 🌐 Website

@jhendrixMSFT
Joel Hendrix (jhendrixMSFT) added this pull request to the merge queue Sep 10, 2026
Merged via the queue into Azure:main with commit 0b96c78 Sep 10, 2026
38 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

emitter:go Issues for @azure-tools/typespec-go emitter

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants