Project scenario:
xxx.go xxx_unit test and code of test.go are open. The code is not in gopath and the project root set by idea.
Background:
Gopath:/users/ZYJ/go project root:/users/ZYJ/study/demogo source file:/users/ZYJ/study/demo/go/SRC/xxx_ test.go
Problem Description:
xxx.go xxx_test.go is stored separately xxx_test.go compilation error
command-line-arguments [command-line-arguments.test]
Cause analysis:
Go test XXX executed by golang IDE_test.go runs as file by default and does not import dependent files. You need to actively import dependencies
Usually: the project is in gopath or project root directory, and the dependency can be found normally
Solution:
go test -v xxxx.go xxxx_test.go
Golang ide multiple selections for quick operation
Read More:
- Go declares that the local variable does not use command line arguments. Main. Go: 4:6: a declared but not used
- SpringBoot Error running ‘Application’: Command line is too long.Shorten command line for
- [Solved] Error running XxlJobExecutorHiveApplication. Command line is too long. Shorten the command line via
- Error running ‘PigSellCabinetApplication’: Command line is too long. Shorten command line for PigSellCabinetApplication or also for Spring Boot default configuration
- [Solved] Error running ‘LocalTest‘: Command line is too long. Shorten command line for LocalTest or also for…
- [Solved] Error running ‘WebApplication‘: Command line is too long. Shorten command line for WebApplication or
- [MAC] How to Solve zsh Error: command not found: umi
- How to Solve J-link Error (Two Command Errors & Solution)
- (How to Fix) Ora-00600: internal error code, arguments: [4194]
- How to Solve Hexo init error: bash: hexo: command not found
- How to Fix msgsend() error: to many arguments to function call, expected 0, have2
- How to Solve error: command ‘C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.0\bin\nvcc.exe‘ failed
- [Solved] There are test failures. Please refer to D:\Java_study\springboot\springboot-sugon-3\target\surefire-reports for the individual test results.
- [Go] Solve panic: runtime error: invalid memory address or nil pointer dereference in golang
- [Solved] Intellij IDEA Error: Command line is too long
- package golang.org/x/net/XXX: unrecognized import path “golang.org/x/net/xxx“…
- [Solved] Intellij IDEA Run Error: Command line is too long
- GCC error: unrecognized command line option ‘-no-pie’
- Error running ‘xxxx‘“: Command line is too long… [How to Solve]
- visual studio Error D8016 ‘/ZI’ and ‘/Gy-‘ command-line options are incompatible