diff --git a/src/OutputGenerator/Go/GoEnumResolver.php b/src/OutputGenerator/Go/GoEnumResolver.php index 95495ea..df09be2 100644 --- a/src/OutputGenerator/Go/GoEnumResolver.php +++ b/src/OutputGenerator/Go/GoEnumResolver.php @@ -57,7 +57,7 @@ private function convertEnumToGoEnumProperties(array $properties, string $enum): } $this->usedConstantsStore[] = $const; - $spaces = str_repeat(' ', $maxEnumPropNameLength - strlen($prop->getName()) + 1); + $spaces = str_repeat(' ', $maxEnumPropNameLength - strlen($const) + 1); $value = $prop->isNumeric() ? $prop->getValue() : sprintf('"%s"', $prop->getValue()); $string .= sprintf("\n\t%s$spaces%s = %s", $const, $enum, $value); diff --git a/src/OutputGenerator/Go/GoTypeResolver.php b/src/OutputGenerator/Go/GoTypeResolver.php index b2c57b0..87027af 100644 --- a/src/OutputGenerator/Go/GoTypeResolver.php +++ b/src/OutputGenerator/Go/GoTypeResolver.php @@ -81,9 +81,9 @@ private function resolveBase(PhpBaseType $type, ?DtoType $dto): string $type->equalsTo(PhpBaseType::string()) => 'string', $type->equalsTo(PhpBaseType::bool()) => 'bool', $type->equalsTo(PhpBaseType::mixed()), - $type->equalsTo(PhpBaseType::object()) => 'interface{}', + $type->equalsTo(PhpBaseType::object()), $type->equalsTo(PhpBaseType::array()), - $type->equalsTo(PhpBaseType::iterable()) => '[]interface{}', + $type->equalsTo(PhpBaseType::iterable()) => 'interface{}', $type->equalsTo(PhpBaseType::null()) => 'null', $type->equalsTo(PhpBaseType::self()) => "*{$dto->getName()}", // * for prevent recursive definition default => throw new Exception('Unknown base PHP type: %s' . json_encode($type)) diff --git a/src/OutputGenerator/Go/OutputFilesProcessorProvider.php b/src/OutputGenerator/Go/OutputFilesProcessorProvider.php index f466bfe..b0e65bf 100644 --- a/src/OutputGenerator/Go/OutputFilesProcessorProvider.php +++ b/src/OutputGenerator/Go/OutputFilesProcessorProvider.php @@ -19,9 +19,9 @@ public static function provide(?OutputFilesProcessor $outputFilesProcessor = nul [ new PrependAutogeneratedNoticeFileProcessor( text: <<