工具实例化
This commit is contained in:
		
							
								
								
									
										34
									
								
								util/init.go
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										34
									
								
								util/init.go
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,34 @@ | ||||
| // Package util ... | ||||
| // | ||||
| // Description : util ... | ||||
| // | ||||
| // Author : go_developer@163.com<白茶清欢> | ||||
| // | ||||
| // Date : 2023-08-10 14:34 | ||||
| package util | ||||
|  | ||||
| var ( | ||||
| 	// UserAgent ... | ||||
| 	UserAgent *userAgent | ||||
| 	// Browser ... | ||||
| 	Browser *browser | ||||
| 	// IP ... | ||||
| 	IP *ip | ||||
| 	// URL ... | ||||
| 	URL *ownURL | ||||
| ) | ||||
|  | ||||
| func init() { | ||||
| 	UserAgent = &userAgent{ | ||||
| 		list: defaultUserAgentList, | ||||
| 	} | ||||
| 	Browser = &browser{ | ||||
| 		commandTable: map[string]string{ | ||||
| 			"windows": "start", | ||||
| 			"darwin":  "open", | ||||
| 			"linux":   "xdg-open", | ||||
| 		}, | ||||
| 	} | ||||
| 	IP = &ip{} | ||||
| 	URL = &ownURL{} | ||||
| } | ||||
		Reference in New Issue
	
	Block a user