Skip to content

Commit

Permalink
feat[golang]: compatible field of inside protocol class
Browse files Browse the repository at this point in the history
  • Loading branch information
jaysunxiao committed Oct 15, 2023
1 parent efd0178 commit a917f84
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ public static void createCppProtocolFile(ProtocolRegistration registration) thro
protocolClazzName, protocolId, protocolClazzName, writeObject.trim(), protocolClazzName, readObject.trim());

var outputPath = StringUtils.format("{}/{}/{}.h"
, GenerateCppUtils.protocolOutputPath
, protocolOutputPath
, GenerateProtocolPath.getProtocolPath(protocolId)
, protocolClazzName);
FileUtils.writeStringToFile(new File(outputPath), protocolTemplate, true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,14 +126,8 @@ public static void createGoProtocolFile(ProtocolRegistration registration) throw
, protocolClazzName, protocolId, protocolClazzName, protocolClazzName
, writeObject.trim(), protocolClazzName, protocolClazzName, readObject.trim());

var protocolPath = GenerateProtocolPath.protocolAbsolutePath(protocolId);
if (StringUtils.isEmpty(protocolPath)) {
protocolPath = protocolClazzName;
} else if (protocolPath.contains(StringUtils.SLASH)) {
protocolPath = StringUtils.substringAfterLast(protocolPath, StringUtils.SLASH);
}
var outputPath = StringUtils.format("{}/{}/{}.go", protocolOutputPath, protocolOutputRootPath, protocolClazzName);
FileUtils.writeStringToFile(outputPath, protocolTemplate, true);
var outputPath = StringUtils.format("{}/{}.go", protocolOutputPath, protocolClazzName);
FileUtils.writeStringToFile(new File(outputPath), protocolTemplate, true);
}

private static String fieldDefinition(ProtocolRegistration registration) {
Expand Down

0 comments on commit a917f84

Please sign in to comment.