aboutsummaryrefslogtreecommitdiff
path: root/pkg/config/yaml.go
diff options
context:
space:
mode:
authorRené 'Necoro' Neumann <necoro@necoro.eu>2021-06-02 23:05:49 +0200
committerRené 'Necoro' Neumann <necoro@necoro.eu>2021-06-02 23:10:40 +0200
commit54d3ea0e7bce0a97db63c9cfa7b54794743b42a8 (patch)
tree87c532727839a8285273736e83577b81297164dc /pkg/config/yaml.go
parent97d4fb607f5b4de1319bf20dae03b29e14010404 (diff)
downloadfeed2imap-go-54d3ea0e7bce0a97db63c9cfa7b54794743b42a8.tar.gz
feed2imap-go-54d3ea0e7bce0a97db63c9cfa7b54794743b42a8.tar.bz2
feed2imap-go-54d3ea0e7bce0a97db63c9cfa7b54794743b42a8.zip
Change handling of NULL nodes to new yaml.v3 semantics
Diffstat (limited to '')
-rw-r--r--pkg/config/yaml.go21
1 files changed, 7 insertions, 14 deletions
diff --git a/pkg/config/yaml.go b/pkg/config/yaml.go
index c82a57e..48269ba 100644
--- a/pkg/config/yaml.go
+++ b/pkg/config/yaml.go
@@ -13,9 +13,8 @@ import (
)
const (
- strTag = "!!str"
- nullTag = "!!null"
- emptyTag = ""
+ strTag = "!!str"
+ nullTag = "!!null"
)
type config struct {
@@ -51,19 +50,13 @@ func (grpFeed *configGroupFeed) isFeed() bool {
}
func (grpFeed *configGroupFeed) target(autoTarget bool) string {
- tag := grpFeed.Target.ShortTag()
- switch tag {
- case strTag:
- return grpFeed.Target.Value
- case nullTag:
- return ""
- case emptyTag:
- if !autoTarget {
+ if !autoTarget || !grpFeed.Target.IsZero() {
+ if grpFeed.Target.ShortTag() == nullTag {
+ // null may be represented by ~ or NULL or ...
+ // Value would hold this representation, which we do not want
return ""
}
- // tag not set and autoTarget is on: continue on
- default:
- panic("unexpected tag " + tag + " for target node")
+ return grpFeed.Target.Value
}
if grpFeed.Feed.Name != "" {
6c1135a8c&follow=1'>add cgit_httpscheme() -> http:// or https://Diego Ongaro2-0/+12 2009-06-07Return http statuscode 404 on unknown branchLars Hjemli3-0/+6 2009-06-07Add head-include configuration option.Mark Lodato3-1/+6 2009-03-15CGIT 0.8.2.1v0.8.2.1Lars Hjemli1-1/+1 2009-03-15Fix doc-related glitches in Makefile and .gitignoreLars Hjemli2-1/+6 2009-03-15ui-snapshot: avoid segfault when no filename is specifiedLars Hjemli1-6/+17 2009-03-15fix segfault when displaying empty blobsEric Wong1-5/+8 2009-02-19Add support for HEAD requestsLars Hjemli2-0/+7 2009-02-19Add support for ETag in 'plain' viewLars Hjemli4-0/+5 2009-02-12ui-tree: escape ascii-text properly in hexdump viewLars Hjemli1-4/+9 2009-02-12Makefile: add doc-related targetsLars Hjemli1-2/+17