# go: Fix quoting of targeting expression for non-fish shells \(\#14821\) · gitcafe/zed

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

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

Visibility: public

Requested revision: 5de5d5bc56999bf0f56195748588e9a9963e93c4

Requested commit: 5de5d5bc56999bf0f56195748588e9a9963e93c4

Commit: 5de5d5bc56999bf0f56195748588e9a9963e93c4

Tree: 39d1de03146b5056925156520de28630893b1bff

Author: Thorsten Ball

Committer: GitHub

## Message

```
go: Fix quoting of targeting expression for non-fish shells (#14821)

This fixes #14818.

The change in #14055 broke the tasks in `zsh` (and I suspect in `bash`,
`sh` too), because what was executed was NOT

    $ go test . -run '^TestThis$'

but instead this:

    $ go test . -run \'^TestThis$\'

And in `zsh` this means that `'` is part of the argument passed to `go`,
which means the targeting string is wrong.

Since the problem in `fish` doesn't seem to be the `^` but the `$`, we
can only escape that, which makes the escaped string work in `zsh` and
`fish` and `bash` (in which I've tested this change here)

Release Notes:

- go: Fix running single tests by changing the quoted expression in the
`go test` command to work again in `bash`, `zsh`, etc.
([#14818](https://github.com/zed-industries/zed/issues/14818))
```

## Parents

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

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