Here’s a version that works for me:
;; Compile .scm files and install.
(every (lambda (file)
(let ((go-file (string-append module-dir "/"
(basename file ".scm") ".go")))
;; Install source module.
(install-file file module-dir)
;; Compile and install module.
(zero? (system* "guild" "compile" "-L" cwd
"-o" go-file file))))
If you have any questions about this just ask!