If you are on the branch you want to rename:
$ git branch -m new-name
If you are on a different branch:
$ git branch -m old-name new-name
Delete the old-name remote branch and push the new-name local branch.
// Copyright 2017 Kranz. All rights reserved. | |
// Use of this source code is governed by a MIT-style | |
// license that can be found in the LICENSE file. | |
package main | |
import ( | |
"os" | |
"log" | |
"io" | |
"bufio" |
// Package main | |
// Copyright 2017 Kranz. All rights reserved. | |
// Use of this source code is governed by a MIT-style | |
// license that can be found in the LICENSE file. | |
/** | |
Test read file by chunks | |
➜ read ll | |
total 13241936 | |
drwxr-xr-x 5 rlopes staff 170B 16 Jan 01:19 ./ |
# OS | |
# export GOOS=linux | |
# ROOT FILES | |
export GOROOT=/usr/local/go | |
# Define here your path of GO projects | |
export GOPATH=$HOME/Projects | |
# Export go project in terminal | |
export GOBIN=$GOPATH/bin |
# Convert | |
openssl rsa -in ~/.ssh/id_rsa -outform pem > id_rsa.pem | |
# Permission | |
chmod 700 id_rsa.pem |
package main | |
import ( | |
"net/http" | |
"fmt" | |
"flag" | |
"log" | |
) | |
var ( |
package main | |
import ( | |
"fmt" | |
"os" | |
"net/http" | |
"log" | |
"context" | |
"time" | |
) |
// Copyright 2017 rodkranz. All rights reserved. | |
// Use of this source code is governed by a MIT-style | |
// license that can be found in the LICENSE file. | |
package main | |
import ( | |
"fmt" | |
"runtime" | |
"time" | |
) |
I had a problem with go get
using private repository on gitlab from our company.
I lost a few minutes trying to find a solution.... and I did find one:
You need to get a private token at:
https://gitlab.mycompany.com/profile/account
Configure you git to add extra header with your private token:
$ git config --global http.extraheader "PRIVATE-TOKEN: YOUR_PRIVATE_TOKEN"
#!/bin/bash | |
[ -d "$DIRECTORY" ] || mkdir coverage | |
for pkg in $(go list ./... | tail +2); do | |
name=$(echo "$pkg" | rev | cut -d'/' -f1 | rev) | |
go test -coverprofile=coverage/${name}.cover.out ${pkg} | |
done | |
echo "mode: set" > coverage/coverage.out && cat coverage/*.cover.out | grep -v mode: | sort -r | awk '{if($1 != last) {print $0;last=$1}}' >> coverage/coverage.out | |
go tool cover -html='coverage/coverage.out' -o 'coverage/coverage.html' |