From 91675879292b38ca27c5dd14c47ca711e30b4112 Mon Sep 17 00:00:00 2001 From: astaxie Date: Fri, 8 Jan 2016 01:20:34 +0800 Subject: [PATCH] add Params for input --- context/input.go | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/context/input.go b/context/input.go index 90ebecfc..c37204bd 100644 --- a/context/input.go +++ b/context/input.go @@ -274,6 +274,17 @@ func (input *BeegoInput) Param(key string) string { return "" } +// Params returns the map[key]value. +func (input *BeegoInput) Params() map[string]string { + m := make(map[string]string) + for i, v := range input.pnames { + if i <= len(input.pvalues) { + m[v] = input.pvalues[i] + } + } + return m +} + // SetParam will set the param with key and value func (input *BeegoInput) SetParam(key, val string) { input.pvalues = append(input.pvalues, val)