From 7c51b10d15b9d308203c2b7173b3a2f904e67c75 Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Mon, 8 Jul 2024 16:20:33 +0100 Subject: [PATCH] configstruct: skip items with `config:"-"` --- fs/config/configstruct/configstruct.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/fs/config/configstruct/configstruct.go b/fs/config/configstruct/configstruct.go index 758519a0a..4d8c941f9 100644 --- a/fs/config/configstruct/configstruct.go +++ b/fs/config/configstruct/configstruct.go @@ -116,6 +116,10 @@ func Items(opt interface{}) (items []Item, err error) { fieldType := defType.Field(i) fieldName := fieldType.Name configName, hasTag := fieldType.Tag.Lookup("config") + if hasTag && configName == "-" { + // Skip items with config:"-" + continue + } if !hasTag { configName = camelToSnake(fieldName) }