# languages: Fix command used for Go subtests \(\#42734\) · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/aaa116d1293a34650cfed12a4733e70ce2c24790)

Repository: [gitcafe/zed](https://git.cafe/gitcafe/zed)

Visibility: public

Requested revision: aaa116d1293a34650cfed12a4733e70ce2c24790

Requested commit: aaa116d1293a34650cfed12a4733e70ce2c24790

Commit: aaa116d1293a34650cfed12a4733e70ce2c24790

Tree: 1cff2ab9b7a4bdfecfdd59169b649eb23bd017f8

Author: Dino

Committer: GitHub

## Message

````
languages: Fix command used for Go subtests (#42734)

The command used to run go subtests was breaking if the test contained
square brackets, for example:

```
go test . -v -run ^TestInventoryCheckout$/^\[test\]_test_checkout$
```

After a bit of testing it appears that the best way to actually resolve
this in a way supported by `go test` is to wrap this command in quotes.
As such, this commit updates the command to, considering the example
above:

```
go test . -v -run '^TestInventoryCheckout$/^\[test\]_test_checkout$'
```

We also tested escape the square brackets, using `\\\[` instead of `\[`,
but that would lead to a more complex change, so we opted for the
simpler solution of wrapping the command in quotes.

Closes #42347 

Release Notes:

- Fixed command used to run Go subtests to ensure that escaped
characters don't lead to a failure in finding tests to run
````

## Parents

- [c1096d8b631b414580c0184fc21a9431e931e743](https://git.cafe/gitcafe/zed/commit/c1096d8b631b414580c0184fc21a9431e931e743?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/aaa116d1293a34650cfed12a4733e70ce2c24790?format=markdown)
