-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(codegen): add go universe types
- Loading branch information
Showing
1 changed file
with
40 additions
and
0 deletions.
There are no files selected for viewing
40 changes: 40 additions & 0 deletions
40
...en/smithy-go-codegen/src/main/java/software/amazon/smithy/go/codegen/GoUniverseTypes.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
package software.amazon.smithy.go.codegen; | ||
|
||
import software.amazon.smithy.codegen.core.Symbol; | ||
|
||
/** | ||
* Collection of Symbol constants for golang universe types. | ||
* See <a href="https://go.dev/ref/spec#Predeclared_identifiers">predeclared identifiers</a>. | ||
*/ | ||
public class GoUniverseTypes { | ||
public static Symbol Any = universe("any"); | ||
public static Symbol Bool = universe("bool"); | ||
public static Symbol Byte = universe("byte"); | ||
public static Symbol Comparable = universe("comparable"); | ||
|
||
public static Symbol Complex64 = universe("complex64"); | ||
public static Symbol Complex128 = universe("complex128"); | ||
public static Symbol Error = universe("error"); | ||
public static Symbol Float32 = universe("float32"); | ||
public static Symbol Float64 = universe("float64"); | ||
|
||
public static Symbol Int = universe("int"); | ||
public static Symbol Int8 = universe("int8"); | ||
public static Symbol Int16 = universe("int16"); | ||
public static Symbol Int32 = universe("int32"); | ||
public static Symbol Int64 = universe("int64"); | ||
public static Symbol Rune = universe("rune"); | ||
public static Symbol String = universe("string"); | ||
|
||
public static Symbol Uint = universe("uint"); | ||
public static Symbol Uint8 = universe("uint8"); | ||
public static Symbol Uint16 = universe("uint16"); | ||
public static Symbol Uint32 = universe("uint32"); | ||
public static Symbol Uint64 = universe("uint64"); | ||
public static Symbol Uintptr = universe("uintptr"); | ||
|
||
private static Symbol universe(String name) { | ||
return SymbolUtils.createValueSymbolBuilder(name).putProperty(SymbolUtils.GO_UNIVERSE_TYPE, true).build(); | ||
} | ||
} | ||
|