# List dynamic dependencies (shared libraries):
# 1. if it's dynamically linked, you'll see
$ ldd kompose
linux-vdso.so.1 => (0x00007ffe937ea000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f0a7dae5000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f0a7d720000)
/lib64/ld-linux-x86-64.so.2 (0x00007f0a7dd03000)
# 2. if it's statically linked, you'll see
$ ldd kompose
not a dynamic executable
# Recognize the type of data in a file
# 1. if it's dynamically linked, you'll see
$ file kompose
/usr/local/kompose: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.32, BuildID[sha1]=86c6d2ff21297a06cc7319244f35e2671612beae, not stripped
# 2. if it's statically linked, you'll see
$ file kompose
/usr/local/kompose: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), statically linked, not strippedGo executables are statically linked, except when they are not. If you want them to be statically linked, go needs to be compiled without cgo support. To do that,
# Disable cgo
export CGO_ENABLED=0