From d9bc78645bd573fe7474f90b9087f6435bc633a9 Mon Sep 17 00:00:00 2001 From: Hidetatz Yaginuma Date: Sun, 30 Jul 2023 12:51:25 +0900 Subject: [PATCH] use UserHomeDir in stdmod lookup --- stdmod.go | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/stdmod.go b/stdmod.go index 2237b95..98f39e1 100644 --- a/stdmod.go +++ b/stdmod.go @@ -1,5 +1,10 @@ package main +import ( + "os" + "path/filepath" +) + var stdmods = []string{ "os", } @@ -15,8 +20,6 @@ func isstdmod(target string) bool { } func stdmoddir() string { - // todo: In Python, stdlib locates at "/usr/lib/python3.x". - // On distribution, the stdlib must be placed such directory and - // this must point there. - return "/home/hidetatz/shiba/std" + home, _ := os.UserHomeDir() + return filepath.Join(home, "shiba/std") }