package sway import ( "git.milar.in/milarin/slices" ) func (c *Client) RunCommand(cmd string) ([]error, error) { results, err := sendMessage[[]commandResult](c, 0, cmd) if err != nil { return nil, err } errors := slices.Map(slices.Filter(results, commandResult.HasError), commandResult.GetError) return errors, nil }