Skip to content

Commit

Permalink
Merge branch 'main-1.x' into rishav/go/fixclientconfig
Browse files Browse the repository at this point in the history
  • Loading branch information
rishav-karanjit authored Jan 27, 2025
2 parents b614591 + ed2bba0 commit 36b064e
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -514,7 +514,6 @@ private void renderListShape(
);
final var inputType = GoCodegenUtils.getType(
symbolProvider.toSymbol(currentShape),
currentShape,
isExternalShape
);
if (isExternalShape) {
Expand Down Expand Up @@ -611,7 +610,6 @@ private void renderMapShape(
);
final var inputType = GoCodegenUtils.getType(
symbolProvider.toSymbol(currentShape),
currentShape,
isExternalShape
);
if (isExternalShape) {
Expand Down Expand Up @@ -684,7 +682,6 @@ private void renderUnionShape(
!currShapeNamespace.startsWith("smithy");
final var inputType = GoCodegenUtils.getType(
symbolProvider.toSymbol(currentShape),
currentShape,
isExternalShape
);
if (isExternalShape) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -484,7 +484,6 @@ public void generateOrphanShapeSerializer(
inputType =
GoCodegenUtils.getType(
context.symbolProvider().toSymbol(resourceOrService),
resourceOrService,
true
);
} else {
Expand All @@ -497,7 +496,7 @@ public void generateOrphanShapeSerializer(
.concat(context.symbolProvider().toSymbol(serviceShape).getName());
}
} else {
inputType = GoCodegenUtils.getType(curSymbol, shape, true);
inputType = GoCodegenUtils.getType(curSymbol, true);
outputType = DafnyNameResolver.getDafnyType(shape, curSymbol);
}
writerDelegator.useFileWriter(
Expand Down Expand Up @@ -992,11 +991,7 @@ public void generateOrphanShapeDeserializer(
}
} else {
outputType =
GoCodegenUtils.getType(
context.symbolProvider().toSymbol(shape),
shape,
true
);
GoCodegenUtils.getType(context.symbolProvider().toSymbol(shape), true);
}
writerDelegator.useFileWriter(
"%s/%s".formatted(
Expand Down Expand Up @@ -1858,7 +1853,6 @@ private void generateSerializerFunctions(
inputType =
GoCodegenUtils.getType(
context.symbolProvider().toSymbol(visitingShape),
visitingShape,
true
);
Boolean isPointable = context
Expand Down Expand Up @@ -1891,7 +1885,6 @@ private void generateSerializerFunctions(
inputType =
GoCodegenUtils.getType(
context.symbolProvider().toSymbol(resourceOrService),
resourceOrService,
true
);
} else {
Expand Down Expand Up @@ -1962,7 +1955,6 @@ private void generateDeserializerFunctions(
alreadyVisited.add(visitingMemberShape.toShapeId());
var outputType = GoCodegenUtils.getType(
context.symbolProvider().toSymbol(visitingShape),
visitingShape,
true
);
Boolean isPointable = context
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -459,7 +459,7 @@ public String listShape(final ListShape shape) {
}
fieldValue = append(fieldValue, %s)}
""".formatted(
GoCodegenUtils.getType(symbol, shape, true),
GoCodegenUtils.getType(symbol, true),
dataSource,
ShapeVisitorHelper.toNativeShapeVisitorWriter(
memberShape,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,19 +54,20 @@ public static String getType(

public static String getType(
final Symbol symbol,
final Shape shape,
final Boolean includeNamespace
) {
if (
symbol.getProperty(SymbolUtils.GO_ELEMENT_TYPE, Symbol.class).isEmpty()
) {
return includeNamespace
? SmithyNameResolver.getSmithyType(shape, symbol)
? SmithyNameResolver.getSmithyType(
symbol.expectProperty(SymbolUtils.SHAPE, Shape.class),
symbol
)
: symbol.getName();
}
var type = getType(
symbol.expectProperty(SymbolUtils.GO_ELEMENT_TYPE, Symbol.class),
shape,
includeNamespace
);
if (symbol.getProperty(SymbolUtils.GO_MAP).isPresent()) {
Expand Down

0 comments on commit 36b064e

Please sign in to comment.