Skip to content

Instantly share code, notes, and snippets.


Fatih Arslan fatih

View GitHub Profile
fatih /
Last active Dec 31, 2019
Switch between go version using
function switchgo() {
if [ -z $version ]; then
echo "Usage: switchgo [version]"
if ! command -v "go$version" > /dev/null 2>&1; then
echo "version does not exist, download with: "
echo " go get${version}"
fatih / copyast.go
Created Jul 13, 2019
Fork of wire/internal/copyast with support for *ast.File
View copyast.go
// Copyright 2018 The Wire Authors
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,

Keybase proof

I hereby claim:

  • I am fatih on github.
  • I am arslan ( on keybase.
  • I have a public key ASDcvzZWuMBwyPHwpUkOEmBS_jMOB_3NiOjUP-6vPAYePQo

To claim this, I am signing this object:

View test godef
set -eux
cd $(mktemp -d)
export GOPATH=$(mktemp -d)
export PATH=$GOPATH/bin:$PATH
git clone
cd godef
git checkout f2eb530fb8dbca312f4661b985ec2ae5ba5e7b3a
go install
git clone
fatih / md-to-hugo.go
Created Nov 29, 2017
Markdown to Hugo converter
View md-to-hugo.go
package main
import (
fatih / caption-transform.go
Created Nov 16, 2017
Wordpress captions to Hugo shortcodes. This is a terrible hack, not performant. Only here for reference
View caption-transform.go
package main
import (
fatih / changes.diff
Last active Oct 24, 2016
Router example
View changes.diff
--- other.go 2016-10-16 16:23:33.000000000 +0300
+++ demo.go 2016-10-16 16:24:27.000000000 +0300
@@ -9,12 +9,12 @@
var Session *http.Server
-var r Router
+var r *Router
func Run(port string) {
View job.vim
func! CloseHandler(channel)
while ch_status(a:channel) == 'buffered'
echomsg ch_read(a:channel)
let job = job_start(['go', 'build'], {'close_cb': 'CloseHandler'})
View Makefile 2
ifeq ($(strip $(shell git status --porcelain 2>/dev/null)),)
all: build
@echo "==> Building the project"