Skip to content

Commit

Permalink
Fix for the preview.46 (#938)
Browse files Browse the repository at this point in the history
* fix redundant comma when no client params for client factory and pump version

* use moduleName instead of hard code pkg name
  • Loading branch information
tadelesh authored Mar 10, 2023
1 parent a547e23 commit d2c9632
Show file tree
Hide file tree
Showing 169 changed files with 170 additions and 170 deletions.
4 changes: 2 additions & 2 deletions src/generator/clientFactory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ export async function generateClientFactory(session: Session<CodeModel>): Promis
result += `${formatCommentAsBulletItem('credential - used to authorize requests. Usually a credential from azidentity.')}\n`;
result += `${formatCommentAsBulletItem('options - pass nil to accept the default values.')}\n`;

result += `func NewClientFactory(${allClientParams.map(p => {return `${p.language.go!.name} ${formatParameterTypeName(p)}`;}).join(', ')}, credential azcore.TokenCredential, options *arm.ClientOptions) (*ClientFactory, error) {\n`;
result += '\t_, err := arm.NewClient("armcompute.ClientFactory", moduleVersion, credential, options)\n';
result += `func NewClientFactory(${allClientParams.map(p => {return `${p.language.go!.name} ${formatParameterTypeName(p)}`;}).join(', ')}${allClientParams.length>0 ? ',' : ''} credential azcore.TokenCredential, options *arm.ClientOptions) (*ClientFactory, error) {\n`;
result += '\t_, err := arm.NewClient(moduleName+".ClientFactory", moduleVersion, credential, options)\n';
result += '\tif err != nil {\n';
result += '\t\treturn nil, err\n';
result += '\t}\n';
Expand Down
2 changes: 1 addition & 1 deletion src/generator/operations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ export async function generateOperations(session: Session<CodeModel>): Promise<O
}

clientText += `func ${group.language.go!.clientCtorName}(${methodParams.join(', ')}) (*${clientName}, error) {\n`;
clientText += `\tcl, err := ${clientPkg}.NewClient("${session.model.language.go!.packageName}.${clientName}", moduleVersion, credential, options)\n`;
clientText += `\tcl, err := ${clientPkg}.NewClient(moduleName+".${clientName}", moduleVersion, credential, options)\n`;
clientText += "\tif err != nil {\n"
clientText += '\t\treturn nil, err\n';
clientText += '\t}\n';
Expand Down
2 changes: 1 addition & 1 deletion src/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@autorest/go",
"version": "4.0.0-preview.46",
"version": "4.0.0-preview.47",
"description": "AutoRest Go Generator",
"main": "dist/exports.js",
"typings": "dist/exports.d.ts",
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion test/compute/2019-12-01/armcompute/zz_client_factory.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion test/compute/2019-12-01/armcompute/zz_disks_client.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion test/compute/2019-12-01/armcompute/zz_galleries_client.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion test/compute/2019-12-01/armcompute/zz_images_client.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion test/compute/2019-12-01/armcompute/zz_operations_client.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion test/compute/2019-12-01/armcompute/zz_snapshots_client.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion test/compute/2019-12-01/armcompute/zz_usage_client.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit d2c9632

Please sign in to comment.