go testでコンパイルされる実行ファイルは/private/var/folders/zs/*/T/go-build*/b001/<package名>.test として一時的に生成されるので、無理やりコピーして中を見てみる
otool -l hogehoge | less
Load command 12
cmd LC_LOAD_DYLIB
cmdsize 56
name @rpath/libclntsh.dylib.19.1 (offset24)
time stamp 2 Thu Jan 1 09:00:02 1970
current version 0.0.0
compatibility version 0.0.0
//当然ながらLC_PATHは設定されていない
DYLD_FALLBACK_LIBRARY_PATH
This is a colon separated list of directories that contain libraries. If a dylib is not found at its install path, dyld
uses this as a list of directories to search for the dylib. By default, it is set to /usr/local/lib:/usr/lib.
NAME
dyld - the dynamic linker
SYNOPSIS
DYLD_FRAMEWORK_PATH
DYLD_FALLBACK_FRAMEWORK_PATH
DYLD_VERSIONED_FRAMEWORK_PATH
DYLD_LIBRARY_PATH
DYLD_FALLBACK_LIBRARY_PATH
(省略)
DESCRIPTION
The dynamic linker (dyld) checks the following environment variables during the launch of each process.
Note: If System Integrity Protection is enabled, these environment variables are ignored when executing binaries protected by
System Integrity Protection.