After install a golang package, it doesn't work - go

I'm new on golang. According this instructions, to install go-bindata, I should use this command:
$ go get -u github.com/jteeuwen/go-bindata/...
I did it. After that, I checked on $GOPATH/src/jteeuwen/go-bindata/ and there's a file go-bindata.a. It seems like it was installed, but it doesn't work:
$ go-bindata
-bash: go-bindata: command not found
Please, what am I doing wrong?
EDIT: I'm using OS X

You'll need to add $GOPATH/bin to your $PATH.

Related

Need help on setting up Beego and Bee dev tool

Go is already installed in my system.
and path variable is in .bashrc file.
# Golang
export PATH=$PATH:/usr/local/go/bin
$ go version
go version go1.16.14 linux/amd64
Now, I am willing to work with Beego and bee dev tools. For that, I installed Beego and Bee by using these commands.
$ go get -u github.com/beego/beego/v2
$ go get -u github.com/beego/bee/v2
both got successfully installed. but when I am using the command bee version it is resulting this in the Terminal.
Command 'bee' not found, did you mean:
command 'tee' from deb coreutils (8.30-3ubuntu2)
command 'see' from deb mime-support (3.64ubuntu1)
Try: sudo apt install <deb name>
I am a beginner in the programming world. I am not sure How to resolve it. Can Someone help me with this?
I had the same issue. When using the command bee is installed in home/go/bin. What I did was copy the bee file from there and paste it in usr/local/go/bin. Also I used go install instead of go get and at the end of the url I added the version I wanted, eg. #v2.0.2
You need to have GOPATH determination. If you don't, create a folder which named as go and it needs to have src,pkg,bin folders.
When you install successfully, you can see bee file in bin folder.
NOTE: You can see go environment with go env command.

go-swagger: command not found

Trying to install go-swagger on Ubuntu.
I have installed brew(Linuxbrew):
sh -c "$(curl -fsSL https://raw.githubusercontent.com/Linuxbrew/install/master/install.sh)"
Next I did:
brew tap go-swagger/go-swagger
brew install go-swagger
typing swagger version
it answers: swagger: command not found.
anything else(-help, -version not working too)
What I did wrong?
Use this:
git clone https://github.com/go-swagger/go-swagger
cd go-swagger
go install ./cmd/swagger
Verify using:
swagger version
Running brew tap go-swagger/go-swagger && brew install go-swagger and then re-running command go-swagger worked for me. Any more details that can be provided here?
This command may also assist you, since you're utilizing go already... might be problematic if utilizing go modules or not.
go get -u github.com/go-swagger/go-swagger/cmd/swagger
You're missing $GOPATH/bin in your path reason why it cannot find the it
Potential fix:
echo 'export PATH="${GOPATH-"~/go"}/bin:$PATH"' >> ~/.bashrc
source ~/.bashrc
To install go-swagger run below command in GO PATH
go get -u github.com/go-swagger/go-swagger/cmd/swagger
To check the version and help run
swagger version
swagger -h

Mac OSX Terminal not Recognizing installed CLI Tool

I'm trying to literally download and run the ElectronNet demo (found here). I install the CLI tool, which appears to be accomplished successfully, but when I try to use the tool, terminal does not recognize it. Shown below:
% dotnet tool install electronnet.cli -g
Tool 'electronnet.cli' is already installed.
%electronize start
zsh: command not found: electronize
What could be going on here?
I guess it's something with your path&zsh,
if you try:
~/.dotnet/tools/electronize start
is that work for you?
If so, you can fix your path by editing ~/.zshrc, add this:
export PATH="/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/share/dotnet/bin"
and source the file by running: ". ~/.zshrc"

Brew install class-dump doesn't work. How to fix it?

My mac is having MacOS 10.12.4 (Sierra). And I have installed homebrew using command line. This is what look like when I run "brew config" command.
Then I wanted to install class-dump using following command.
"brew install class-dump". But when it gives me following error. Can some one tell me the reason and what should I do?
I was able to solve the problem by installing class-dump manually without using home brew. I downloaded the class-dump in using this link. Then copy the class-dump file to the following location "/usr/local/bin". Then all works fine
Here is a one liner for the lazy people if you already have wget:
$ wget -qO- http://stevenygard.com/download/class-dump-3.5.tar.gz | tar xvz - -C /usr/local/bin

Using Bash insteal of Perl? (bashrc)

I was using a bash script in my bashrc and until now everything worked.
Today, i decided to install Perl on my computer (since I'm looking to learn the language) using the method on the website learn.pearl
curl -L xrl.us/installperlnix | bash
(urls are not accepted )
The problem is that now, my script doesn't work anymore, I'm having the error:
"no such file
export PERLBREW_BASHRC_VERSION=0.78"
I tried to use the command "perlbrew switch-off" but it seems that I don't have the program perlbrew installed, and my bashrc is starting with #!/bin/bash so I'm completely lost on you to fix the problem.
I would appreciate some help.
Thanks !
Make sure that you got everything to download the perlbrew, like curl or wget, it is simple to check, try one of theses:
which curl
which wget
If you have one of them you are able to download, otherwise you will need to install either curl or wget.
The latest realease of perlbrew is 0.78.
After theses first steps try to download it again as you did.
There is a mini tutorial which you can use as a guide:
https://perlbrew.pl/
Also I am not sure if you have it installed so you could use:
which perlbrew
To find out if you have it or not. Maybe you forgot the step as describe in the perlbrew site:
sudo cpan App::perlbrew
perlbrew init
Because it seems like your environment was not set yet.

Resources