everyone. I have a problem with golang 's build.
The details:
I have a folder named "12" and creating a go source file named 12_test.go. Codes are below:
package main
import "fmt"
func main() {
fmt.Println("Hello world")
}
.Then typing "go build 12_test.go". Something going wrong:
"go build command-line-arguments: no buildable Go source files in D:\12"
So,Could someone tell me why? Thanks and apology for my poor English.
The suffix _test has special meaning in Go. It is where you put tests for your go programs. The build tool will ignore these completely .. they are run with go test.
Remove _test from the file name or just name it test.go.
Related
I used to see "Run Test | Debug Test" links top of every test function in VS Code for Go. But they are missing now. How can I re-enable them?
This picture shows what I am talking about:
Check your options to confirm that the Go test explorer is enabled:
Preferences > Settings > User Settings > find "go test enable code lens"
Taken directly from the go.dev doc for the testing package
To write a new test suite, create a file whose name ends _test.go that contains the TestXxx functions as described here. Put the file in the same package as the one being tested.
Please ensure that your test file name ends in _test.go, and that the function you're trying to test starts with Test (like it does in your snippet).
Had the same issue today. In my case opening the Command Palette (Ctrl+Shift+P) and running "OmniSharp: Restart OmniSharp" fixed it.
Same thing here - simply closed down VS Code and opened it back up again... they all appeared once more.
This happened to me, though I was writing Javascript (not Go).
To fix that, I need to make sure the Es6 import & export statements are correct (-- correctly importing the correct item from the correct file path),, -- for this current test js file & relevant imported js files (or even all files in current project).
(Then you must save the test js file to refresh it.)
The Test Explorer's Output panel may(?<) throw an Error to indicate that.
I have this situation when there are many folders in the project I opened in VScode. But these options appear only when I open the folder containing the script I want to run the test in in a new window in VSCode. I don't know why, it's weird.
i just installed YouCompleteMe for Vim through vundle. It works, but it shows only the words contained in the current file. I want to use it to develop c++ programs, how can i configure it to show autocompletion from c++ headers file in /usr/include for example? Thanks a lot.
You need to navigate to ~/.vim/bundles/YouCompleteMe and run the installation script with --clang-completer, so do ./install.sh --clang-completer. After it finishes you should have support for C like languages.
You may also need to place let g:ycm_global_ycm_extra_conf = '~/.vim/bundle/YouCompleteMe/cpp/ycm/.ycm_extra_conf.py' in your ~/.vimrc.
I have installed with pathogen. I tried the above instructions with ./install.sh --clang-complete. After this, it did not work, and I indeed had to add the path. But it was different than in another reply here, namely
let g:ycm_global_ycm_extra_conf = '.vim/bundle/YouCompleteMe/third_party/ycmd/cpp/ycm/.ycm_extra_conf.py'
so there is an extra "third_party/ycmd" in the path.
While the suggestions here might work in the beginning, I am not sure it's the proper way to go. According to YCM developer, whenever you start a project, you need a new .ycm_extra_conf.py file
From https://valloric.github.io/YouCompleteMe/#ubuntu-linux-x64-super-quick-installation
YCM looks for a .ycm_extra_conf.py file in the directory of the opened file or in any directory above it in the hierarchy (recursively); when the file is found, it is loaded (only once!) as a Python module. YCM calls a FlagsForFile method in that module which should provide it with the information necessary to compile the current file. You can also provide a path to a global .ycm_extra_conf.py file, which will be used as a fallback. To prevent the execution of malicious code from a file you didn't write YCM will ask you once per .ycm_extra_conf.py if it is safe to load. This can be disabled and you can white-/blacklist files. See the Options section for more details.
While you might only need to modify the compile flags from the vanilla .ycm_extra_conf.py, I feel it is advisable to create a new file for every project you start.
Everything that the folks here have said is correct. I just want to add that as of 2017, the "install.sh" script is deprecated. Now, you have to use the install.py script instead by typing
./install.py --clang-completer
Also, in your .vimrc file, instead of ".vim/bundle/blahblahblah", you'll need to add a "~/" in front of the address by adding:
let g:ycm_global_ycm_extra_conf = "~/.vim/bundle/YouCompleteMe/third_party/ycmd/cpp/ycm/.ycm_extra_conf.py"
to your .vimrc file, to give it an absolute path from the Home directory so that Vim can find the ".ycm_extra_conf.py" file. Otherwise, you might experience some funny behavior.
I just wanted to add if you don't want to manually define a config file there is this neat little repository that will auto generate it. https://github.com/rdnetto/YCM-Generator
I am beginning a project on Python that implements PyAIML and I wrote the following code to create a brain for my project:
import aiml
k=aiml.Kernel()
k.learn("std-startup.xml")
k.respond("LOAD AIML B")
k.saveBrain("jarvis.brn")
When I run the program I get this error: WARNING: No match found for input: LOAD AIML B
I understand that I needed to download an AIML set to begin development. So I did, but I'm stuck there.
Please help. I'm a noob programmer so don't be rough on me for this dumb mistake.
Thanks in advance!
The .learn() method will not throw an error if the file you pass it does not exist, and I'm guessing that you are trying to learn patterns from "std-startup.xml" without having this file in your directory.
Make sure the file std-startup.xml is in the directory you are running your script from. You should also have a directory called standard in your working directory that contains the standard set of aiml files. Basically your directory should look like this:
mydir/my_script.py
mydir/std-startup.xml
mydir/standard/a-bunch-of-std-aiml-files.aiml
These files can be found in the "Other Files/Standard AIML Set/" folder on the pyaiml source forge site. Go to that folder and download the one of the tarballs or the zip.
A few things:
If your AIML is loading properly, pyAIML will respond with a line that will read something like:
Loading std-startup.aiml... done (1.00 seconds)
It will not necessarily throw an error if it does not find a file to load, so if you don't see this line, pyAIML has not loaded the AIML file.
I don't see 'std-startup.xml' in the sourceforge directory either, but this shouldn't matter. All that you're loading is any AIML file that will allow you to test the kernel. Try loading the 'self-test.aiml' file in the /aiml directory instead. (Double-check to make sure the file suffix in your code is .aiml and not .xml)
k.respond() is for giving the bot some input and 'LOAD AIML B' is just a test phrase. Once you've loaded 'self-test.aiml' try k.respond('test date') and you should get
The date is Wed Mar 13 01:37:07 2013 in response.
I have some old code that I would like to test using Junit. After importing it into Eclipse it looks like this:
After this, I try to test the class ACos. I've entered some values, but it doesn't work. I get this:
What have I done wrong?
Looks like your class under test is in the main package (= ""). Try without jscicalc.pobject.
Correction: If pobject is supposed to be the package, you should set it as source folder. (Right-click -> Build path on it).
Your Java code should be under the src folder and not the pobject folder.
It probably needs to be in a package as well, but that's not as easy to tell without seeing the code within it. It should also be obvious with the errors that occur when moving it.
Can anyone guide me what could be the problem in the mentioned below:-
alt text http://lh5.ggpht.com/_D1MfgvBDtsU/S5iLmYivj1I/AAAAAAAAABU/8Mquam_XxZ4/s912/dll%20issue.PNG
This PP folder is present in the following path at my desk "E:\WINCE600\PLATFORM\COMMON\SRC\SOC\COMMON_FSL_V2_PDK1_7\IPUV3"
In this IPUV3 folder, PP folder is present which does the resize,rotation & conversion task of an image. This PP folder consists of PDK & SDK . Inside PDK folder there is a file called Ppclass.cpp which i have modified.
After modifying the Ppclass.cpp i have
rebuild the PP folder to check whether
in my project the modification is
reflected or not. But later i found
that the problem is of pp.dll which
even after the rebuild of PP folder
the new pp.dll is not highlighted.
Also the path for iMX51-EVK-PDK1_7 is as follows:
"E:\WINCE600\PLATFORM\iMX51-EVK-PDK1_7\target"
So now i want advice that how to sort this problem. I am sure that this problem is related to pp.dll
Please guide me to follow the correct step. I will be very thankful to u all.
Thanks in Advance
Was everything working as expected before the code change?
Are you getting any build errors?
Do you have a DIRS file in the IPUV3 directory that specifies the two subdirectories?
What is the problem? State what you did, what you expect and what was the outcome. It is not clear right now.
Update:
According to the comment below it seems that the build process is having trouble parsing one of your SOURCES files. From the error my guess is you have someting similar to:
SOURCELIBS=E:\...
Try:
SOURCELIBS=\
E:\...
The \ symbol tells the tool that there is are more values on the next line.
By the way, I don't know who wrote this on the SOURCES file, but I think it is bad practice to use absolute paths. You should use the macro for your platform path _TARGETPLATROOT. Use it like this: $(_TARGETPLATROOT)\...