go

Go is an open source programming language that makes it easy to build simple, reliable, and efficient software. You can easily add it to your Lando app by adding an entry to the services key in your app's .lando.yml.

Supported versions

Example

# Go server example
name: go

# Give me http://go.lndo.site and https://go.lndo.site
proxy:
  appserver:
    - go.lndo.site

# Spin up services to run a basic go server
services:

  # Create a go instance
  appserver:

    # go version 1.8
    type: go:1.8

    # Optionally create certs in /certs that can be used by your application
    # to listen over https. Creates the following certs your app can use
    #
    #   - /certs/cert.key
    #   - /certs/cert.crt
    #   - /certs/cert.pem
    #
    # ssl: true

    # Optionally specify a command to run when you start your go service up.
    #
    # If you are using go as a server you are going to want to define this.
    # This can be either a string or array.
    #
    # If you are just spinning up a go container to run cli things
    # you can leave this blank and the container will boot up and stay on
    #
    command: go run /app/http1.go

    # Install some extra server packages
    # extras:
    #  - "apt-get update -y"
    #  - "apt-get install vim -y"

    # Print a message just to demonstrate this
    # build:
    # - "cd $LANDO_MOUNT & echo 'Holla!'"

# Add some nice command routing
tooling:

  # Any go service with a defined command (aka not running in cli only mode)
  # Will also spin up a go cli container called `SERVICENAME_cli` (appserver_cli)
  # in this example.
  #
  # This will allow you to run things like `lando npm install` without needing
  # to `lando start` first. This is particularly needed for go based projects
  # since you almost always need to run `npm install` before you can boot up your
  # app successfully.
  go:
    service: appserver_cli

You will need to rebuild your app with lando rebuild to apply the changes to this file. You can check out the full code for this example over here.

results matching ""

    No results matching ""