Skip to content

Commit

Permalink
Fix var names casing
Browse files Browse the repository at this point in the history
  • Loading branch information
andrii-balitskyi committed Sep 27, 2024
1 parent 00c6f70 commit 382f701
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/lib/code-sample/go.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export const createGoRequest = (

const getGoPackageName = (path: string): string => {
if (!isPathNested(path)) {
return DEFAULT_GO_PACKAGE_NAME
return defaultGoPackageName
}

const firstPathPart = path.split('/').slice(1)[1]
Expand All @@ -59,12 +59,12 @@ const generateImports = ({
const imports: string[] = []

if (isReqWithParams) {
const defaultPackageImport = `import ${DEFAULT_GO_PACKAGE_NAME} "${GO_PACKAGE_BASE_PATH}"`
const defaultPackageImport = `import ${defaultGoPackageName} "${goPackageBasePath}"`
imports.push(defaultPackageImport)
}

if (goPackageName !== DEFAULT_GO_PACKAGE_NAME && isReqWithParams) {
const nestedPackageImport = `import ${goPackageName} "${GO_PACKAGE_BASE_PATH}/${goPackageName}"`
if (goPackageName !== defaultGoPackageName && isReqWithParams) {
const nestedPackageImport = `import ${goPackageName} "${goPackageBasePath}/${goPackageName}"`
imports.push(nestedPackageImport)
}

Expand Down

0 comments on commit 382f701

Please sign in to comment.