I am currently looking at this project (Mattermost) that has a certain line in the makefile that I'm confused about:
$(GO) run $(GOFLAGS) $(GO_LINKER_FLAGS) ./cmd/platform/*.go --disableconfigwatch &
What is the meaning of ./cmd/platform/*.go
? What specific files are executed? The program executes correctly when I type it in the terminal.
I am trying to enter the command line arguments in an IDE but I need a specific entry file.....
In computer programming, in particular in a Unix-like environment, glob patterns specify sets of filenames with wildcard characters. For example, the Unix command mv *.txt textfiles/ moves (mv) all files with names ending in .txt from the current directory to the directory textfiles. Here, * is a wildcard standing for "any string of characters" and *.txt is a glob pattern. The other common wildcard is the question mark (?), which stands for one character.
Clearly, ./cmd/platform/*.go
, starting in the current directory, looks in the cmd/platform
directory for files matching the wildcard *.go
.
The ls ./cmd/platform/*.go
command will list the files on Linux.
So, the go run ./cmd/platform/*.go
command compiles and runs these Go (*.go
) source files. See Command go documentation: Compile and run Go program.