title: exec format error when running AWS Golang Lambda
body: <p>I have a go application, structured like this:</p>
  
  <p>cmd<br/>|<br/>reports<br/>|<br/>main.go</p>
  
  <p>main.go imports <code>internal/reports</code> package and has a single function, main(), which delegates call to <code>aws-lambda-go/lambda.Start()</code> function.</p>
  
  <p>Code is build running the commands (snippet):</p>
  
  <pre><code>cd internal/reports &amp;&amp; go build handler.go
  cd ../..
  go build -o reports ../cmd/reports/main.go &amp;&amp; chmod +x reports &amp;&amp; zip reports.zip reports
  </code></pre>
  
  <p><code>reports.zip</code> is uploaded to AWS Lambda, which in turns throws an error when <code>Test</code> button is pressed:</p>
  
  <pre><code>{
    "errorMessage": "fork/exec /var/task/reports: exec format error",
    "errorType": "PathError"
  }
  </code></pre>
  
  <p><code>reports</code> is set as Lambda's <code>Handler</code>.</p>
  
  <p>Also, code is build on Ubuntu 14.04 machine, as a part of <code>aws/codebuild/ubuntu-base:14.04</code> Docker Image, on <strong>AWS CodeBuild</strong>. There should be no environment issues here, even though the error suggests a cross-platform problem.</p>
  
  <p>Any ideas?</p>