Twelve Go Best Practices
Francesc Campoy Flores Gopher at Google @francesc http://campoy.cat/+
- Best practices
Twelve Go Best Practices
Francesc Campoy Flores Gopher at Google @francesc http://campoy.cat/+
| rustup check # Check for updates to Rust toolchains and rustup | |
| rustup component list # List installed and available components of the current Rust toolchain | |
| rustup install stable | |
| rustup default beta | |
| rustup update # updating to the latest version | |
| rustup toolchain list # list installed toolchains | |
| rustup toolchain install stable-gnu # to install the GNU ABI (application binary interface) | |
| cargo new [OPTIONS] <path> | |
| # create a new Cargo package in the given directory; |
| package akkahttptest | |
| import akka.actor.ActorSystem | |
| import akka.http.Http | |
| import akka.stream.FlowMaterializer | |
| import akka.http.server._ | |
| import akka.http.marshalling.PredefinedToResponseMarshallers._ | |
| import akka.stream.scaladsl.{HeadSink, Source} | |
| object Proxy extends App { |
| package akkahttptest | |
| import akka.actor.ActorSystem | |
| import akka.http.Http | |
| import akka.stream.FlowMaterializer | |
| import akka.http.server._ | |
| import akka.http.marshalling.PredefinedToResponseMarshallers._ | |
| import akka.stream.scaladsl.{HeadSink, Source} | |
| object Proxy extends App { |
| package mapmap | |
| trait ECtx | |
| trait KCtx | |
| trait Var[C, T] { | |
| def get(c: C): T | |
| } |
| package controllers | |
| import config.{EndpointConfig => Config} | |
| import play.api.mvc._ | |
| import play.api.Play.current | |
| import play.api.libs.ws.{WSRequest, WS} | |
| import scala.concurrent.Future | |
| import scala.concurrent.ExecutionContext.Implicits.global |
| using System.Net; | |
| using Microsoft.Bot.Connector; | |
| public static async Task<HttpResponseMessage> Run(HttpRequestMessage req, TraceWriter log) | |
| { | |
| log.Verbose($"C# HTTP trigger function processed a request. RequestUri={req.RequestUri}"); | |
| var msg = await req.Content.ReadAsAsync<Message>(); |
| #!/bin/bash | |
| # Inspired by http://www.devthought.com/code/create-a-github-pull-request-from-the-terminal/ | |
| targetbranch=master | |
| if test "$1"; then | |
| targetbranch=$1 | |
| fi | |
| repo=`git remote -v | grep -m 1 "(push)" | sed -e "s/.*github.com[:/]\(.*\)\.git.*/\1/"` |
| #!/bin/bash | |
| # customizable | |
| LIST_DATA="#{window_name} #{pane_title} #{pane_current_path} #{pane_current_command}" | |
| FZF_COMMAND="fzf-tmux -p --delimiter=: --with-nth 4 --color=hl:2" | |
| # do not change | |
| TARGET_SPEC="#{session_name}:#{window_id}:#{pane_id}:" | |
| # select pane |
Life is too short for tedious, manual release processes.
Here, we will use Maven's [Release plugin][maven-release] to execute releases.
Instead of triggering the release process manually, we will use a
[GitHub Actions][gh-actions] workflow on the master branch. All development
work is done on the dev branch (or feature branches) and a release is done
when (and only when) the dev branch is merged with the master branch.