You should prefix errors with the name of the package:

```go
return nil, fmt.Errorf("matrix: invalid directive string: %s", str)
```