Skip to content
This repository was archived by the owner on Jan 28, 2021. It is now read-only.

Commit 3dd4413

Browse files
juanjuxkuba--
authored andcommitted
Add build, tag for oniguruma, remove for mysql_go_regex, update README (#660)
1 parent 4aabb5e commit 3dd4413

File tree

4 files changed

+4
-17
lines changed

4 files changed

+4
-17
lines changed

README.md

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -41,16 +41,6 @@ To install it, run:
4141
go get gopkg.in/src-d/go-mysql-server.v0
4242
```
4343

44-
## Regular expression engine
45-
46-
The **go-mysql-server** uses [oniguruma](github.com/kkos/oniguruma) as a default regular expression engine, so it's required to install the oniguruma first.
47-
For Linux (if you have the `apt-get` tool) or OSX (if you have `homebrew` tool) the easiest way is by command:
48-
```sh
49-
make oniguruma # on linux you may need `sudo`
50-
```
51-
52-
If you want to use regex engine from go's standard library, you have to compile **go-mysql-server** with `--tags mysql_go_regex` argument.
53-
5444
## Documentation
5545

5646
* [go-mysql-server godoc](https://godoc.org/github.com/src-d/go-mysql-server)

internal/regex/regex_go.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
// +build mysql_go_regex
2-
31
package regex
42

53
import (

internal/regex/regex_oniguruma.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// +build oniguruma
2+
13
package regex
24

35
import (

internal/regex/regex_test.go

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@ func dummy(s string) (Matcher, Disposer, error) { return nil, nil, nil }
1010

1111
func getDefault() string {
1212
for _, n := range Engines() {
13-
if n == "go" {
13+
if n == "oniguruma" {
1414
return n
1515
}
1616
}
1717

18-
return "oniguruma"
18+
return "go"
1919
}
2020

2121
func TestRegistration(t *testing.T) {
@@ -33,9 +33,6 @@ func TestRegistration(t *testing.T) {
3333
engines = Engines()
3434
require.Len(engines, number)
3535

36-
err = Register("oniguruma", dummy)
37-
require.Equal(true, ErrRegexAlreadyRegistered.Is(err))
38-
3936
err = Register("nil", dummy)
4037
require.NoError(err)
4138
require.Len(Engines(), number+1)

0 commit comments

Comments
 (0)