Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Go moq : running "moq": exec: "moq": executable file not found in $PATH

when trying the example of the moq framework, I get the following exception when I enter "go generate":

example.go:5: running "moq": exec: "moq": executable file not found in $PATH

What should I do? I'm using Kubuntu 16.04

PS: I tried

export PATH=$PATH:/home/[...]/go/src/github.com/matryer/moq

without success

like image 220
Racater Avatar asked Oct 16 '25 11:10

Racater


1 Answers

First, install using the following command:

go install github.com/matryer/moq@latest

Go binary should be added to the global PATH

 export PATH=$PATH:$HOME/go/bin

worked for me on MAC

like image 189
Oscar Gallardo Avatar answered Oct 19 '25 01:10

Oscar Gallardo