You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@devlake.apache.org by GitBox <gi...@apache.org> on 2022/06/24 07:52:14 UTC

[GitHub] [incubator-devlake] klesh commented on a diff in pull request #2340: [Refactor][Gitee] use GetDal instead of deprecated GetDb

klesh commented on code in PR #2340:
URL: https://github.com/apache/incubator-devlake/pull/2340#discussion_r905808488


##########
models/domainlayer/didgen/domain_id_generator.go:
##########
@@ -88,19 +88,30 @@ func NewDomainIdGenerator(entityPtr interface{}) *DomainIdGenerator {
 
 func (g *DomainIdGenerator) Generate(pkValues ...interface{}) string {
 	id := g.prefix
-	for i, pkValue := range pkValues {
+	isMatch := false
+
+	for _, pkValue := range pkValues {
 		// append pk
 		id += ":" + fmt.Sprintf("%v", pkValue)
 		// type checking
 		pkValueType := reflect.TypeOf(pkValue)
 		if pkValueType == wildcardType {
 			break
-		} else if pkValueType != g.pkTypes[i] {
-			panic(fmt.Errorf("primary key type does not match: %s should be %s",
-				g.pkNames[i],
-				g.pkTypes[i].Name(),
+		}
+
+		for _, pkType := range g.pkTypes {

Review Comment:
   I don't think this is correct. Would you mind explaining why you did it?



-- 
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: commits-unsubscribe@devlake.apache.org

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