Browse Source

Share private field

Volodymyr Tkach 2 years ago
parent
commit
b594cfbbf5
2 changed files with 5 additions and 5 deletions
  1. 2 2
      utils/http/apiserv/apiserv.go
  2. 3 3
      utils/http/apiserv/param.go

+ 2 - 2
utils/http/apiserv/apiserv.go

@@ -115,9 +115,9 @@ func (s ServeMux) ServeHTTP(w http.ResponseWriter, r *http.Request) {
 					mParams.Lock()
 					for _, p := range rs[0] {
 						if _, ok := mParams.list[r]; !ok {
-							mParams.list[r] = []Param{{value: p}}
+							mParams.list[r] = []Param{{Value: p}}
 						} else {
-							mParams.list[r] = append(mParams.list[r], Param{value: p})
+							mParams.list[r] = append(mParams.list[r], Param{Value: p})
 						}
 						select {
 						case <-r.Context().Done():

+ 3 - 3
utils/http/apiserv/param.go

@@ -3,16 +3,16 @@ package apiserv
 import "strconv"
 
 type Param struct {
-	value string
+	Value string
 }
 
 func (p Param) Integer() int64 {
-	if v, err := strconv.ParseInt(p.value, 10, 64); err == nil {
+	if v, err := strconv.ParseInt(p.Value, 10, 64); err == nil {
 		return v
 	}
 	return 0
 }
 
 func (p Param) String() string {
-	return p.value
+	return p.Value
 }