diff --git a/in.go b/in.go index a3679b8c..56d7fdec 100644 --- a/in.go +++ b/in.go @@ -11,14 +11,8 @@ import ( // Get (business logic) func Get(request GetRequest, github Github, git Git, outputDir string) (*GetResponse, error) { - if request.Params.SkipDownload != "" { - skipDownload, err := strconv.ParseBool(request.Params.SkipDownload) - if err != nil { - return nil, fmt.Errorf("failed to parse skip_download: %s", err) - } - if skipDownload { - return &GetResponse{Version: request.Version}, nil - } + if request.Params.SkipDownload { + return &GetResponse{Version: request.Version}, nil } pull, err := github.GetPullRequest(request.Version.PR, request.Version.Commit) @@ -86,7 +80,7 @@ func Get(request GetRequest, github Github, git Git, outputDir string) (*GetResp // GetParameters ... type GetParameters struct { - SkipDownload string `json:"skip_download"` + SkipDownload bool `json:"skip_download"` } // GetRequest ... diff --git a/in_test.go b/in_test.go index ffacd577..0d931a08 100644 --- a/in_test.go +++ b/in_test.go @@ -109,7 +109,7 @@ func TestGetSkipDownload(t *testing.T) { Commit: "commit1", CommittedDate: time.Time{}, }, - parameters: resource.GetParameters{SkipDownload: "true"}, + parameters: resource.GetParameters{SkipDownload: true}, }, }