Skip to content

docs: TROUBLESHOOTING points at a viper_yaml3 build tag that is gone - #2168

Open
ump45nose wants to merge 1 commit into
spf13:masterfrom
ump45nose:troubleshooting-yaml3-tag
Open

ump45nose wants to merge 1 commit into
spf13:masterfrom
ump45nose:troubleshooting-yaml3-tag

Conversation

@ump45nose

Copy link
Copy Markdown

Overview:

TROUBLESHOOTING.md tells users to pass a viper_yaml3 build tag that does not exist in this module. Reworded the advice so it points at something a user can actually do.

What problem does it solve?:

The last line of the "Unquoted 'y' and 'n' characters" section reads:

Upgrading to YAML v3 (for the time being this is possible by passing the viper_yaml3 tag to your build)

There is no such tag any more. The only build tags in the module are viper_bind_struct and viper_finder:

internal/features/bind_struct_default.go:1://go:build !viper_bind_struct
internal/features/bind_struct.go:1://go:build viper_bind_struct
internal/features/finder.go:1://go:build viper_finder
internal/features/finder_default.go:1://go:build !viper_finder

and YAML v3 is unconditionally the codec Viper uses:

  • internal/encoding/yaml/codec.go:3 — import "go.yaml.in/yaml/v3" (no variant file behind a tag)
  • go.mod:15 — go.yaml.in/yaml/v3 v3.0.4

So a user following this instruction today adds a tag with no effect and still sees YAML 1.1 boolean resolution. The replacement says the upgrade already happened inside Viper, and points at the two real options: upgrade Viper, or supply a YAML v3 codec through the codec registry (viper.WithCodecRegistry, viper.Codec).

Docs only, one line.

Special notes for a reviewer:

  • I did not claim which Viper release made v3 unconditional (the local clone is shallow, so I could not check history) — the wording sticks to what the current tree shows.
  • Overlap with my own open docs: point TROUBLESHOOTING at the maintained mapstructure fork #2162, which edits this same file: that PR changes the mapstructure import path in line 5 (## Unmarshaling doesn't work), this one changes line 32 in a different section. gh pr diff 2162 confirms the hunks are ~27 lines apart, so the two are independent and either can land first.
  • Testing boundary: no build or test run was possible in this environment (the sandbox refused go build/go test), but the change is markdown text; the cited tag list was produced by searching every //go:build line in the repo.
  • AI assistance disclosure: prepared with an AI coding agent; the tag and import facts were re-verified by reading the files, and I am responsible for the result.

The only build tags left in the module are viper_bind_struct and viper_finder (internal/features/*.go), and the YAML codec imports go.yaml.in/yaml/v3 unconditionally (internal/encoding/yaml/codec.go:3, go.mod:15), so there is nothing for a user to pass.
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