title: error "fork/exec /var/task/main: no such file or directory" while executing aws-lambda function
body: <p>Getting <code>error fork/exec /var/task/main: no such file or directory</code> while executing lambda function.</p>
  <p>I am using windows platform to run and build code in Go.</p>
  <p>I have done following steps to deploy go aws-lambda handler:</p>
  <ol>
  <li>Written code in go language with VSCode in windows platform</li>
  <li>Build project with : go build main.go</li>
  <li>Convert main.exe to main.zip</li>
  <li>Uploaded main.zip with handler name main aws-lambda fuction using aws console account</li>
  <li>Created test event to test lambda function</li>
  <li>Got error &quot;fork/exec /var/task/main: no such file or directory while executing lambda function&quot;</li>
  </ol>
  <pre><code>package main
  
  import (
      &quot;fmt&quot;
  
      &quot;github.com/aws/aws-lambda-go/lambda&quot;
  )
  
  // Request represents the requested object
  type Request struct {
      ID    int    `json:&quot;ID&quot;`
      Value string `json:&quot;Value&quot;`
  }
  
  // Response represents the Response object
  type Response struct {
      Message string `json:&quot;Message&quot;`
      Ok      bool   `json:&quot;Ok&quot;`
  }
  
  // Handler represents the Handler of lambda
  func Handler(request Request) (Response, error) {
      return Response{
          Message: fmt.Sprint(&quot;Process Request Id %f&quot;, request.ID),
          Ok:      true,
      }, nil
  }
  
  func main() {
      lambda.Start(Handler)
  }
  </code></pre>
  <p>build command</p>
  <pre><code>go build main.go
  </code></pre>
  <p>Detail Error in AWS console</p>
  <pre><code>{
    &quot;errorMessage&quot;: &quot;fork/exec /var/task/main: no such file or directory&quot;,
    &quot;errorType&quot;: &quot;PathError&quot;
  }
  </code></pre>
  <p>Log Output in AWS console</p>
  <pre><code>START RequestId: 9ef206ed-5538-407a-acf0-06673bacf2d7 Version: $LATEST
  fork/exec /var/task/main: no such file or directory: PathError
  null
  END RequestId: 9ef206ed-5538-407a-acf0-06673bacf2d7
  REPORT RequestId: 9ef206ed-5538-407a-acf0-06673bacf2d7  Duration: 0.64 ms   Billed Duration: 100 ms Memory Size: 512 MB Max Memory Used: 31 MB  Init Duration: 1.49 ms
  </code></pre>