pg-*.txt is referred to as a glob pattern. In the latter example you are asking your shell to execute a given command which includes your glob pattern. The shell evaluates the glob pattern as a pre-processing step. The Go program then receives a list of files that have been matched by the pattern.
You will have to update your IntelliJ settings to run the program within a shell as described in In JetBrains IDEs (e.g. CLion, IntelliJ), external tools cannot use globbing patterns Stack Overflow question. By evaluating the initial go run command within a shell process your program will receive the arguments as expected.
An alternative solution is to treat all your arguments as glob patterns and utilize the
filepath.Glob(pattern string) (matches string, err error) function to manually expand on the provided argument. This strategy requires a little more preprocessing from your program but is more tolerant to the runtime environment. You can see an example of this kind of expansion in this Go Playground Example.