Skip to content

Fix package example names for current Go#34

Open
HNO3Miracle wants to merge 1 commit into
HumanSecurity:mainfrom
HNO3Miracle:fix-example-names-current-go
Open

Fix package example names for current Go#34
HNO3Miracle wants to merge 1 commit into
HumanSecurity:mainfrom
HNO3Miracle:fix-example-names-current-go

Conversation

@HNO3Miracle

@HNO3Miracle HNO3Miracle commented Jun 10, 2026

Copy link
Copy Markdown

Current Go rejects several examples because their names are interpreted as examples for identifiers that do not exist in this package:

  • ExampleBasicUnmarshal -> BasicUnmarshal
  • ExampleExcludeKnownFields -> ExcludeKnownFields
  • ExampleUnmarshalErrorHandling -> UnmarshalErrorHandling
  • ExampleUnmarshalFromJSONMapErrorHandling -> UnmarshalFromJSONMapErrorHandling

These are package-level examples, so this renames them to the documented package-example form using a lowercase suffix after an underscore. This keeps the examples visible and executable without introducing fake exported identifiers.

Validation:

  • go test ./...

Signed-off-by: HNO3Miracle <xiangao.or@isrc.iscas.ac.cn>
@HNO3Miracle HNO3Miracle force-pushed the fix-example-names-current-go branch from 9cb9677 to 9052c20 Compare June 22, 2026 07:31
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.

1 participant