doulan9188 2017-05-10 16:36
浏览 83
已采纳

运行目录中的所有文件,运行./cmd/*.go是什么?

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.....

  • 写回答

1条回答 默认 最新

  • dormbaf90464 2017-05-10 16:53
    关注

    Wikipedia

    glob (programming)

    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.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?