Skip to content

Refactor code fix deprecations and format - #103

Open
peczenyj wants to merge 8 commits into
dmarkham:masterfrom
peczenyj:refactor-code-fix-deprecations-and-format
Open

Refactor code fix deprecations and format#103
peczenyj wants to merge 8 commits into
dmarkham:masterfrom
peczenyj:refactor-code-fix-deprecations-and-format

Conversation

@peczenyj

Copy link
Copy Markdown
Contributor

fixing ioutil deprecations and format source code

there are still two deprecations that I have no idea how to fix properly:

perhaps by using github.com/iancoleman/strcase solve some of the issues

stringer.go:249:9: SA1019: packages.LoadSyntax is deprecated: LoadSyntax exists for historical compatibility and should not be used. Please directly specify the needed fields using the Need values. (staticcheck)
		Mode: packages.LoadSyntax,
		      ^
stringer.go:355:11: SA1019: strings.Title has been deprecated since Go 1.18 and an alternative has been available since Go 1.0: The rule Title uses for word boundaries does not handle Unicode punctuation properly. Use golang.org/x/text/cases instead. (staticcheck)
			return strings.Title(s)
			       ^
stringer.go:359:20: SA1019: strings.Title has been deprecated since Go 1.18 and an alternative has been available since Go 1.0: The rule Title uses for word boundaries does not handle Unicode punctuation properly. Use golang.org/x/text/cases instead. (staticcheck)
			title := []rune(strings.Title(s))
			                ^

@peczenyj

Copy link
Copy Markdown
Contributor Author

conflicts solved

Resolved conflicts in stringer.go and golden_test.go:

- stringer.go: kept master's generateOptions-struct signature for
  Generator.generate, which supersedes this branch's reformatting of
  the old long parameter list.
- golden_test.go: kept master's runGoldenTest(t, test, opts) signature
  plus t.Helper(), and this branch's loadGolden(t, name) refactor that
  reads each golden file once and reports failures via t.Fatalf.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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