aboutsummaryrefslogtreecommitdiff
path: root/lib/path/route_node.go
diff options
context:
space:
mode:
authorShulhan <ms@kilabit.info>2024-01-25 00:42:16 +0700
committerShulhan <ms@kilabit.info>2024-01-25 00:42:16 +0700
commita055c87a24417dbc6760224ad9dcfb204751e702 (patch)
tree251080edd973eef33e0fa6dbd4ce6f2cb78ac552 /lib/path/route_node.go
parent2c90844a04228ec7ba810689c68289748f0ccdfd (diff)
downloadpakakeh.go-a055c87a24417dbc6760224ad9dcfb204751e702.tar.xz
lib/path: add method Set to Route
The Set method set or replace the key's value in path with parameter val. If the key exist it will return true; otherwise it will return false. This changes remove unnecessary field key in routeNode and optimize the String method using [strings.Builder].
Diffstat (limited to 'lib/path/route_node.go')
-rw-r--r--lib/path/route_node.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/path/route_node.go b/lib/path/route_node.go
index dd1b06b0..b89ab24e 100644
--- a/lib/path/route_node.go
+++ b/lib/path/route_node.go
@@ -10,7 +10,7 @@ package path
// A sub-path that start with colon ":" is a key; otherwise its normal
// sub-path.
type routeNode struct {
- key string
name string
+ val string
isKey bool
}