Skip to content

Support string fields in the filecontent mapper - #655

Closed
be-student wants to merge 1 commit into
alecthomas:masterfrom
be-student:codex/482-string-filecontent
Closed

be-student wants to merge 1 commit into
alecthomas:masterfrom
be-student:codex/482-string-filecontent

Conversation

@be-student

Copy link
Copy Markdown

Fixes #482.

Allow type:"filecontent" on string fields, including named string types, using the same file/stdin reading path as []byte. Preserve the file's bytes when converting to a string. Unsupported scalar and slice types still return validation errors; the existing panic fix from #625 remains covered with integer and string-slice controls.

Validation: string file, default/named-string, and stdin regressions fail before the change. Full tests, race tests, repository-pinned golangci-lint, gofmt, and diff checks pass. go vet -structtag=false ./... passes; plain vet flags the project's existing shorthand struct tags. Tested on Go 1.27.1/macOS; lint uses the repository's Hermit toolchain. README documents the supported field types.

@be-student be-student closed this Sep 12, 2026
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.

String type support for filecontent

1 participant