Skip to content

Instantly share code, notes, and snippets.

View shahidhk's full-sized avatar

Shahidh K Muhammed shahidhk

View GitHub Profile
@subfuzion
subfuzion / dep.md
Last active June 14, 2023 15:46
Concise guide to golang/dep

Overview

This gist is based on the information available at golang/dep, only slightly more terse and annotated with a few notes and links primarily for my own personal benefit. It's public in case this information is helpful to anyone else as well.

I initially advocated Glide for my team and then, more recently, vndr. I've also taken the approach of exerting direct control over what goes into vendor/ in my Dockerfiles, and also work from isolated GOPATH environments on my system per project to ensure that dependencies are explicitly found under vendor/.

At the end of the day, vendoring (and committing vendor/) is about being in control of your dependencies and being able to achieve reproducible builds. While you can achieve this manually, things that are nice to have in a vendoring tool include:

@carmstrong
carmstrong / Dockerfile
Created August 14, 2015 00:01
Mount CoreOS VHD
FROM ubuntu:12.04
WORKDIR /tmp
RUN apt-get install -y bzip2 qemu wget
RUN modprobe nbd
RUN wget http://stable.release.core-os.net/amd64-usr/647.2.0/coreos_production_azure_image.vhd.bz2
RUN bzip2 -d coreos_production_azure_image.vhd.bz2
RUN qemu-nbd -c /dev/nbd0 coreos_production_azure_image.vhd
RUN mkdir /mnt/coreos
@mattes
mattes / check.go
Last active June 12, 2024 19:31
Check if file or directory exists in Golang
if _, err := os.Stat("/path/to/whatever"); os.IsNotExist(err) {
// path/to/whatever does not exist
}
if _, err := os.Stat("/path/to/whatever"); !os.IsNotExist(err) {
// path/to/whatever exists
}