File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -57,7 +57,7 @@ type CommenterOptions struct {
5757}
5858
5959func encodeURL (k string ) string {
60- return url .QueryEscape (string ( k ) )
60+ return url .QueryEscape (k )
6161}
6262
6363func GetFunctionName (i interface {}) string {
@@ -71,7 +71,7 @@ func ConvertMapToComment(tags map[string]string) string {
7171 var sb strings.Builder
7272 i , sz := 0 , len (tags )
7373
74- //sort by keys
74+ // sort by keys
7575 sortedKeys := make ([]string , 0 , len (tags ))
7676 for k := range tags {
7777 sortedKeys = append (sortedKeys , k )
@@ -80,9 +80,9 @@ func ConvertMapToComment(tags map[string]string) string {
8080
8181 for _ , key := range sortedKeys {
8282 if i == sz - 1 {
83- sb .WriteString (fmt .Sprintf ("%s=%v " , encodeURL (key ), encodeURL (tags [key ])))
83+ sb .WriteString (fmt .Sprintf ("%s='%s' " , encodeURL (key ), encodeURL (tags [key ])))
8484 } else {
85- sb .WriteString (fmt .Sprintf ("%s=%v ," , encodeURL (key ), encodeURL (tags [key ])))
85+ sb .WriteString (fmt .Sprintf ("%s='%s' ," , encodeURL (key ), encodeURL (tags [key ])))
8686 }
8787 i ++
8888 }
You can’t perform that action at this time.
0 commit comments