package mainimport ( "fmt" "os" "path/filepath")func main() { // 현재 작업 디렉토리 경로 가져오기 workPath, err := os.Getwd() if err != nil { panic(err) } fmt.Println(workPath) // 실행 파일 디렉토리 경로 가져오기 exeFilePath, err := os.Executable() if err != nil { panic(err) } exePath := filepath.Dir(exeFilePath) fmt.Println(exePath)} 심볼릭 링크를 사용할 경우 OS 별로 경로가 다를 수 있다.