Skip to content

Commit

Permalink
forgot symbols for these
Browse files Browse the repository at this point in the history
  • Loading branch information
lucix-aws committed Sep 28, 2023
1 parent 5c37c00 commit 34a5b0a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@
public final class SmithyGoTypes {
private SmithyGoTypes() { }

public static final class Ptr {
public static final Symbol String = SmithyGoDependency.SMITHY_PTR.valueSymbol("String");
public static final Symbol Bool = SmithyGoDependency.SMITHY_PTR.valueSymbol("Bool");
}

public static final class Middleware {
public static final Symbol Stack = SmithyGoDependency.SMITHY_MIDDLEWARE.pointableSymbol("Stack");
public static final Symbol SerializeInput = SmithyGoDependency.SMITHY_MIDDLEWARE.pointableSymbol("SerializeInput");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@
import java.util.Set;
import software.amazon.smithy.codegen.core.CodegenException;
import software.amazon.smithy.go.codegen.GoWriter;
import software.amazon.smithy.go.codegen.SmithyGoDependency;
import software.amazon.smithy.go.codegen.SymbolUtils;
import software.amazon.smithy.go.codegen.SmithyGoTypes;
import software.amazon.smithy.go.codegen.integration.ProtocolGenerator;
import software.amazon.smithy.model.knowledge.TopDownIndex;
import software.amazon.smithy.model.node.Node;
Expand Down Expand Up @@ -174,13 +173,9 @@ private GoWriter.Writable generateStaticLiteral(StaticContextParamDefinition lit
return writer -> {
Node value = literal.getValue();
if (value.isStringNode()) {
writer.writeInline("$T($S)",
SymbolUtils.createValueSymbolBuilder("String", SmithyGoDependency.SMITHY_PTR).build(),
value.expectStringNode().getValue());
writer.writeInline("$T($S)", SmithyGoTypes.Ptr.String, value.expectStringNode().getValue());
} else if (value.isBooleanNode()) {
writer.writeInline("$T($L)",
SymbolUtils.createValueSymbolBuilder("Bool", SmithyGoDependency.SMITHY_PTR).build(),
value.expectBooleanNode().getValue());
writer.writeInline("$T($L)", SmithyGoTypes.Ptr.Bool, value.expectBooleanNode().getValue());
} else {
throw new CodegenException("unrecognized static context param value type");
}
Expand Down

0 comments on commit 34a5b0a

Please sign in to comment.