Skip to content
This repository has been archived by the owner on Oct 17, 2024. It is now read-only.

Some sanity in file naming #51

Merged
merged 3 commits into from
Oct 30, 2017
Merged

Some sanity in file naming #51

merged 3 commits into from
Oct 30, 2017

Conversation

PaulMaddox
Copy link
Contributor

@PaulMaddox PaulMaddox commented Oct 30, 2017

When generating polymorphic/union types, do not name the file/struct by
joining the possible types. This lead to some horrific generated
filenames such as awsserverlessfunction_s3eventorsnseventorkinesiseventordynamodbeventorapieventorscheduleeventorcloudwatcheventeventoriotruleeventoralexaskillevent.go
(!!!). This broke compilation on Windows.

This change updates the generation to use the property name instead of it's possible types.

For example, this:

template := &cloudformation.Template{
    Resources: map[string]interface{}{
        "MySAMFunction": cloudformation.AWSServerlessFunction{
            Handler: "nodejs6.10",
            CodeUri: &cloudformation. AWSServerlessFunction_StringOrS3Location{
                String: &codeuri,
            },
        },
    },
}

Becomes this:

template := &cloudformation.Template{
    Resources: map[string]interface{}{
        "MySAMFunction": cloudformation.AWSServerlessFunction{
            Handler: "nodejs6.10",
            CodeUri: &cloudformation.AWSServerlessFunction_CodeUri{
                String: &codeuri,
            },
        },
    },
}

This fixes #37

When generating polymorphic/union types, do not name the file/struct by
joining the possible types. This lead to some horrific generated
filenames such as
awsserverlessfunction_s3eventorsnseventorkinesiseventordynamodbeventorapieventorscheduleeventorcloudwatcheventeventoriotruleeventoralexaskillevent.go
(!!!). This actually broke compilation on Windows.

This change updates the generation to use the property name instead of
it's possible types.
@PaulMaddox PaulMaddox merged commit 9ad3ba3 into awslabs:master Oct 30, 2017
@amnyulwa
Copy link

I'm still facing the same issue when doing the: go get github.com/awslabs/aws-sam-local

Error: go build github.com/awslabs/aws-sam-local/vendor/github.com/awslabs/goformation/cloudformation: C:\Go\pkg\tool\windows_amd64\compile.exe: fork/exec C:\Go\pkg\tool\windows_amd64\compile.exe: The filename or extension is too long.

@rui-ktei
Copy link

I'm facing the same issue. Will there be a fix on this?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Windows: "go get" Fails due to Path Length
3 participants