diff --git a/README.md b/README.md index b4d5dfe..d81da22 100644 --- a/README.md +++ b/README.md @@ -46,6 +46,14 @@ Goc can collect code coverages at runtime for your long-run golang applications. ... ``` +## Tips + +1. To understand the execution details of goc tool, you can use the `--debug` flag. Also we appreciate if you can provide such logs when submitting a bug to us. + +2. By default, the covered service will listen a random port in order to communicate with the goc server. this may not be suitable in [docker](https://docs.docker.com/engine/reference/commandline/run/#publish-or-expose-port--p---expose) or [kubernetes](https://kubernetes.io/docs/concepts/services-networking/service/#defining-a-service) environment since the port must be exposed explicitly in order to be accessible by others in such environment. For this kind of scenario, you can use `--agentport` flag to specific a fixed port when calling `goc build` or `goc install`. + +3. To use a remote goc server, you can use `--center` flag to compile the target service with `goc build` or `goc install` command. + ## RoadMap - [x] Support code coverage collection for system testing. - [x] Support code coverage counters clear for the services under test at runtime. diff --git a/cmd/commonflags.go b/cmd/commonflags.go index e48f7c9..c12d70e 100644 --- a/cmd/commonflags.go +++ b/cmd/commonflags.go @@ -27,7 +27,7 @@ func addBasicFlags(cmdset *pflag.FlagSet) { func addCommonFlags(cmdset *pflag.FlagSet) { addBasicFlags(cmdset) cmdset.StringVar(&mode, "mode", "count", "coverage mode: set, count, atomic") - cmdset.StringVar(&agentPort, "agentport", "", "specify fixed port for registered service communicate with goc server. if not provided, using a random port") + cmdset.StringVar(&agentPort, "agentport", "", "specify fixed port for registered service communicate with goc server. if not provided, using a random one") cmdset.StringVar(&buildFlags, "buildflags", "", "specify the build flags") // bind to viper viper.BindPFlags(cmdset)