$ gf run -h
USAGE
gf run FILE [OPTION]
ARGUMENT
FILE building file path.
OPTION
-p, --path output directory path for built binary file. it's "manifest/output" in default
-e, --extra the same options as "go run"/"go build" except some options as follows defined
-h, --help more information about this command
EXAMPLE
gf run main.go
gf run main.go --args "server -p 8080"
gf run main.go -mod=vendor
DESCRIPTION
The "run" command is used for running go codes with hot-compiled-like feature,
which compiles and runs the go codes asynchronously when codes change.
10 Comments
beautiful
是否考虑也把config/*.toml 文件的更改,也加入到热更新里面去? 源码似乎只针对go文件进行了热更新。
郭强
配置文件默认有热更新特性:配置管理
black1552
PS D:\go-project\autoUpdate> gf run main.go
2021-09-04 19:24:32.556 build: main.go
2021-09-04 19:24:32.569 go build -o bin\main.exe main.go
2021-09-04 19:24:32.571 build error:
exec: "D:\\go-project\\autoUpdate": file does not exist
PS D:\go-project\autoUpdate> gf run main.go -mod=mod
2021-09-04 19:25:04.416 build: main.go
2021-09-04 19:25:04.428 go build -o bin\main.exe -mod=mod main.go
2021-09-04 19:25:04.431 build error:
exec: "D:\\go-project\\autoUpdate": file does not exist
无法进行编译是怎么回事 直接使用build 也不可以 但是直接使用go build 就没有问题
白夜
郭强 海亮
出现一些奇怪的词:`[I6N7F O][I oNpFeOn]api osppeencaipfii csapteicoinf iic` 好奇怪??
海亮
稳定复现?
白夜
只出现过一次。后续再次执行`gf run ./main.go` 不再输出太多东西了
我的环境是:
海亮
那可能只是终端问题
bugme
gf run mian.go 报 add watch failed for path "/home/bugme/Project/goframe/goframe": no space left on device
设备空间不足?
KingKong
郭强 海亮 麻烦问一下,goframe 应该对macos支持没问题吧。我用的 go 1.18 运行 go run main.go。出现下面的错误,还有一个错误在很长,不好复制,大约是
In file included from ../../go/pkg/mod/github.com/shirou/gopsutil@v3.21.11+incompatible/host/host_darwin_cgo.go:7:
In file included from ./smc_darwin.h:4:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/IOKit.framework/Headers/IOKitLib.h:52:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/IOKit.framework/Headers/OSMessageNotification.h:120:53: error: expected ';' after top level declarator
typedef natural_t OSAsyncReference[kOSAsyncRefCount] __kernel_ptr_semantics;
2 errors generated.
# github.com/shirou/gopsutil/disk
In file included from ../../go/pkg/mod/github.com/shirou/gopsutil@v3.21.11+incompatible/disk/disk_darwin_cgo.go:9:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CoreFoundation.h:60:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFPropertyList.h:17:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFStream.h:16:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFURL.h:1193:83: error: expected ','
kCFURLBookmarkCreationWithSecurityScope API_AVAILABLE(macos(10.7), macCatalyst(13.0)) API_UNAVAILABLE(ios, watchos, tvos) = ( 1UL << 11 ), // Mac OS X 10.7.3 and later, include information in the bookmark data which allows the same sandboxed process to access the resource after being relaunched
^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFURL.h:1194:98: error: expected ','
kCFURLBookmarkCreationSecurityScopeAllowOnlyReadAccess API_AVAILABLE(macos(10.7), macCatalyst(13.0)) API_UNAVAILABLE(ios, watchos, tvos) = ( 1UL << 12 ), // Mac OS X 10.7.3 and later, if used with kCFURLBookmarkCreationWithSecurityScope, at resolution time only read access to the resource will be granted
^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFURL.h:1205:85: error: expected ','
kCFURLBookmarkResolutionWithSecurityScope API_AVAILABLE(macos(10.7), macCatalyst(13.0)) API_UNAVAILABLE(ios, watchos, tvos) = ( 1UL << 10 ), // Mac OS X 10.7.3 and later, use the secure information included at creation time to provide the ability to access the resource in a sandboxed process.
^
3 errors generated.
exit status 2
海亮
看报错,和GoFrame没有关联。错误指向这个库shirou/gopsutil: psutil for golang (github.com) 你是不是没有安装c++编译器