mirror of
https://github.com/0xJacky/nginx-ui.git
synced 2025-05-11 10:25:52 +02:00
chore: prepare v2.0.0-rc.4
This commit is contained in:
parent
5460885bd6
commit
22834f59b4
18 changed files with 144 additions and 119 deletions
|
@ -2,10 +2,11 @@ package nginx
|
|||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/tufanbarisyildirim/gonginx/config"
|
||||
"github.com/tufanbarisyildirim/gonginx/parser"
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
"github.com/tufanbarisyildirim/gonginx/config"
|
||||
"github.com/tufanbarisyildirim/gonginx/parser"
|
||||
)
|
||||
|
||||
func TestNgxConfParse(t *testing.T) {
|
||||
|
@ -44,7 +45,12 @@ func fn(block config.IBlock, deep int) {
|
|||
}
|
||||
}
|
||||
|
||||
fmt.Println(fmt.Sprintf("%s%s %s", strings.Repeat("\t", deep), v.GetName(), strings.Join(v.GetParameters(), " ")))
|
||||
// 将 []config.Parameter 转换为 []string
|
||||
params := make([]string, len(v.GetParameters()))
|
||||
for i, p := range v.GetParameters() {
|
||||
params[i] = p.String()
|
||||
}
|
||||
fmt.Printf("%s%s %s\n", strings.Repeat("\t", deep), v.GetName(), strings.Join(params, " "))
|
||||
fn(v.GetBlock(), deep+1)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue