gogf / gf
Showing 2 of 4 files from the diff.

@@ -86,31 +86,22 @@
Loading
86 86
87 87
func parseConfigNodeLink(node *ConfigNode) *ConfigNode {
88 88
	var match []string
89 -
	// It firstly parses `link` using with type pattern.
90 -
	match, _ = gregex.MatchString(linkPatternWithType, node.Link)
91 -
	if len(match) > 6 {
92 -
		node.Type = match[1]
93 -
		node.User = match[2]
94 -
		node.Pass = match[3]
95 -
		node.Protocol = match[4]
96 -
		node.Host = match[5]
97 -
		node.Port = match[6]
98 -
		node.Name = match[7]
99 -
		if len(match) > 7 {
100 -
			node.Extra = match[8]
101 -
		}
102 -
		node.Link = ""
103 -
	} else {
104 -
		// Else it parses `link` using without type pattern.
105 -
		match, _ = gregex.MatchString(linkPatternWithoutType, node.Link)
106 -
		if len(match) > 6 {
107 -
			node.User = match[1]
108 -
			node.Pass = match[2]
109 -
			node.Protocol = match[3]
110 -
			node.Host = match[4]
111 -
			node.Port = match[5]
112 -
			node.Name = match[6]
113 -
			if len(match) > 7 {
89 +
	if node.Link != "" {
90 +
		match, _ = gregex.MatchString(linkPattern, node.Link)
91 +
		if len(match) > 5 {
92 +
			node.Type = match[1]
93 +
			node.User = match[2]
94 +
			node.Pass = match[3]
95 +
			node.Protocol = match[4]
96 +
			array := gstr.Split(match[5], ":")
97 +
			if len(array) == 2 {
98 +
				node.Host = array[0]
99 +
				node.Port = array[1]
100 +
				node.Name = match[6]
101 +
			} else {
102 +
				node.Name = match[5]
103 +
			}
104 +
			if len(match) > 6 {
114 105
				node.Extra = match[7]
115 106
			}
116 107
			node.Link = ""

@@ -373,9 +373,8 @@
Loading
373 373
	// tableFieldsMap caches the table information retrieved from database.
374 374
	tableFieldsMap = gmap.NewStrAnyMap(true)
375 375
376 -
	// [username[:password]@][protocol[(address)]]/dbname[?param1=value1&...&paramN=valueN]
377 -
	linkPatternWithType    = `(\w+):([\w\-]+):(.+?)@(.+?)\((.+?):(\d+)\)/{0,1}([\w\-]*)\?{0,1}(.*)`
378 -
	linkPatternWithoutType = `([\w\-]+):(.+?)@(.+?)\((.+?):(\d+)\)/{0,1}([\w\-]*)\?{0,1}(.*)`
376 +
	// type:[username[:password]@][protocol[(address)]]/dbname[?param1=value1&...&paramN=valueN]
377 +
	linkPattern = `(\w+):([\w\-]*):(.*?)@(\w+?)\((.+?)\)/{0,1}([\w\-]*)\?{0,1}(.*)`
379 378
)
380 379
381 380
func init() {
Files Coverage
container 95.54%
contrib 71.02%
crypto 80.10%
database 70.33%
debug/gdebug 53.26%
encoding 81.70%
errors 77.88%
frame 53.52%
i18n/gi18n 81.13%
internal 79.29%
net 64.38%
os 70.08%
test/gtest 56.64%
text 89.77%
util 77.34%
Project Totals (579 files) 76.56%
3148532504
go-1.17-386
3148532504
go-1.18-amd64
3148532504
go-1.18-386
3148532504
go-1.17-amd64
3148532504
go-1.15-386
3148532504
go-1.15-amd64
3148532504
go-1.16-amd64
3148532504
go-1.16-386

No yaml found.

Create your codecov.yml to customize your Codecov experience

Sunburst
The inner-most circle is the entire project, moving away from the center are folders then, finally, a single file. The size and color of each slice is representing the number of statements and the coverage, respectively.
Icicle
The top section represents the entire project. Proceeding with folders and finally individual files. The size and color of each slice is representing the number of statements and the coverage, respectively.
Grid
Each block represents a single file in the project. The size and color of each block is represented by the number of statements and the coverage, respectively.
Loading