Copilot commented on code in PR #873:
URL: https://github.com/apache/dubbo-go-samples/pull/873#discussion_r2263319964


##########
config_center/apollo/go-server/cmd/main.go:
##########
@@ -0,0 +1,97 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package main
+
+import (
+       "context"
+)
+
+import (
+       "dubbo.apache.org/dubbo-go/v3"
+       "dubbo.apache.org/dubbo-go/v3/config_center"
+       _ "dubbo.apache.org/dubbo-go/v3/imports"
+
+       "github.com/dubbogo/gost/log/logger"
+)
+
+import (
+       greet "github.com/apache/dubbo-go-samples/config_center/apollo/proto"
+)
+
+// Apollo Configuration Center Parameters
+const (
+       apolloMetaAddress = "tony2c4g:8080"

Review Comment:
   The Apollo meta address is hardcoded to a specific hostname 'tony2c4g:8080'. 
This should be configurable or use a more generic example like 'localhost:8080' 
for better portability.



##########
config_center/apollo/go-client/cmd/main.go:
##########
@@ -0,0 +1,93 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package main
+
+import (
+       "context"
+)
+
+import (
+       "dubbo.apache.org/dubbo-go/v3"
+       "dubbo.apache.org/dubbo-go/v3/config_center"
+       _ "dubbo.apache.org/dubbo-go/v3/imports"
+
+       "github.com/dubbogo/gost/log/logger"
+)
+
+import (
+       greet "github.com/apache/dubbo-go-samples/config_center/apollo/proto"
+)
+
+// Apollo Configuration Center Parameters
+const (
+       apolloMetaAddress = "tony2c4g:8080"
+       apolloAppID       = "SampleApp"
+       apolloCluster     = "default"
+       apolloNamespace   = "dubbo.yml"
+)
+
+const configCenterApolloClientConfig = `## set in config center, namespace is 
'dubbo.yml', appId is 'SampleApp'

Review Comment:
   The constant 'configCenterApolloClientConfig' is defined but never used in 
the code. Consider removing it or documenting its purpose if it's meant for 
reference.



##########
config_center/apollo/go-client/cmd/main.go:
##########
@@ -0,0 +1,93 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package main
+
+import (
+       "context"
+)
+
+import (
+       "dubbo.apache.org/dubbo-go/v3"
+       "dubbo.apache.org/dubbo-go/v3/config_center"
+       _ "dubbo.apache.org/dubbo-go/v3/imports"
+
+       "github.com/dubbogo/gost/log/logger"
+)
+
+import (
+       greet "github.com/apache/dubbo-go-samples/config_center/apollo/proto"
+)
+
+// Apollo Configuration Center Parameters
+const (
+       apolloMetaAddress = "tony2c4g:8080"

Review Comment:
   The Apollo meta address is hardcoded to a specific hostname 'tony2c4g:8080'. 
This should be configurable or use a more generic example like 'localhost:8080' 
for better portability.



##########
config_center/apollo/go-server/cmd/main.go:
##########
@@ -0,0 +1,97 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package main
+
+import (
+       "context"
+)
+
+import (
+       "dubbo.apache.org/dubbo-go/v3"
+       "dubbo.apache.org/dubbo-go/v3/config_center"
+       _ "dubbo.apache.org/dubbo-go/v3/imports"
+
+       "github.com/dubbogo/gost/log/logger"
+)
+
+import (
+       greet "github.com/apache/dubbo-go-samples/config_center/apollo/proto"
+)
+
+// Apollo Configuration Center Parameters
+const (
+       apolloMetaAddress = "tony2c4g:8080"
+       apolloAppID       = "SampleApp"
+       apolloCluster     = "default"
+       apolloNamespace   = "dubbo.yml"
+)
+
+type GreetTripleServer struct {
+}
+
+func (srv *GreetTripleServer) Greet(ctx context.Context, req 
*greet.GreetRequest) (*greet.GreetResponse, error) {
+       resp := &greet.GreetResponse{Greeting: "Hello, " + req.Name}
+       return resp, nil
+}
+
+const configCenterApolloServerConfig = `## set in config center, namespace is 
'dubbo.yml', appId is 'SampleApp'

Review Comment:
   The constant 'configCenterApolloServerConfig' is defined but never used in 
the code. Consider removing it or documenting its purpose if it's meant for 
reference.



-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to