Skip to content

chore: Use reflect helpers from the standard library - #19740

Open
SungJin1212 wants to merge 1 commit into
influxdata:masterfrom
SungJin1212:modernize/reflect
Open

SungJin1212 wants to merge 1 commit into
influxdata:masterfrom
SungJin1212:modernize/reflect

Conversation

@SungJin1212

@SungJin1212 SungJin1212 commented Sep 18, 2026

Copy link
Copy Markdown
Contributor

Summary

Part of the modernize linter series (follow-up to #19675), split out of #19725 as requested in review.
This PR uses reflect.TypeFor instead of reflect.TypeOf((*T)(nil)).Elem(), reflect.TypeAssert instead of Value.Interface().(T), and iterates reflect.Value.Fields() where available (analyzers: reflecttypefor, reflecttypeassert, stditerators).

The rewrite is the output of the modernize linter with only the listed analyzer(s) enabled, applied via golangci-lint run --fix for GOOS=darwin, linux and windows, followed by goimports / golangci-lint fmt to drop imports left unused and regroup new ones.

Checklist

Related issues

resolves #

@telegraf-tiger

Copy link
Copy Markdown
Contributor

Download PR build artifacts for linux_amd64.tar.gz, darwin_arm64.tar.gz, and windows_amd64.zip.
Downloads for additional architectures and packages are available below.

⚠️ This pull request increases the Telegraf binary size by 6.29 % for linux amd64 (new size: 327.6 MB, nightly size 308.2 MB)

📦 Click here to get additional PR build artifacts

Artifact URLs

. DEB . RPM . TAR . GZ . ZIP
amd64.deb aarch64.rpm darwin_amd64.tar.gz windows_amd64.zip
arm64.deb armel.rpm darwin_arm64.tar.gz windows_arm64.zip
armel.deb armv6hl.rpm freebsd_amd64.tar.gz windows_i386.zip
armhf.deb i386.rpm freebsd_armv7.tar.gz
i386.deb ppc64le.rpm freebsd_i386.tar.gz
mips.deb riscv64.rpm linux_amd64.tar.gz
mipsel.deb s390x.rpm linux_arm64.tar.gz
ppc64el.deb x86_64.rpm linux_armel.tar.gz
riscv64.deb linux_armhf.tar.gz
s390x.deb linux_i386.tar.gz
linux_mips.tar.gz
linux_mipsel.tar.gz
linux_ppc64le.tar.gz
linux_riscv64.tar.gz
linux_s390x.tar.gz

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant