You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by GitBox <gi...@apache.org> on 2020/12/27 09:00:30 UTC

[GitHub] [dubbo-go] fangyincheng commented on a change in pull request #932: [Fix] file service discovery path can run in windows

fangyincheng commented on a change in pull request #932:
URL: https://github.com/apache/dubbo-go/pull/932#discussion_r549085533



##########
File path: config_center/file/impl.go
##########
@@ -41,13 +40,29 @@ import (
 	"github.com/apache/dubbo-go/config_center/parser"
 )
 
+var osType string
+var path string
+
 const (
-	PARAM_NAME_PREFIX                 = "dubbo.config-center."
-	CONFIG_CENTER_DIR_PARAM_NAME      = PARAM_NAME_PREFIX + "dir"
-	CONFIG_CENTER_ENCODING_PARAM_NAME = PARAM_NAME_PREFIX + "encoding"
-	DEFAULT_CONFIG_CENTER_ENCODING    = "UTF-8"
+	windows = "windows"
 )
 
+const (
+	ParamNamePrefix               = "dubbo.config-center."
+	ConfigCenterDirParamName      = ParamNamePrefix + "dir"
+	ConfigCenterEncodingParamName = ParamNamePrefix + "encoding"
+	defaultConfigCenterEncoding   = "UTF-8"
+)
+
+func init() {
+	osType = runtime.GOOS
+	if os.IsPathSeparator('\\') { //前边的判断是否是系统的分隔符

Review comment:
       english pls




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org