Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
krzysztofreczek authored Nov 30, 2020
1 parent af829e0 commit d2c6076
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,6 @@ err = s.RegisterRule(r)

The apply function has two arguments: name and groups matched from the name regular expression.

Please note, groups' numbers start from index `1`. Group of index `0` contains the original type name in a format: `package.TypeName`.

See the example:
```go
r, err := scraper.NewRule().
Expand All @@ -69,7 +67,7 @@ r, err := scraper.NewRule().
WithApplyFunc(
func(_ string, groups ...string) model.Info {
// Do some groups sanity checks first, then:
n := fmt.Sprintf("Client of external %s service", groups[2])
n := fmt.Sprintf("Client of external %s service", groups[1])
return model.ComponentInfo(n, "foo client", "gRPC", "TAG")
}).
Build()
Expand Down Expand Up @@ -101,7 +99,7 @@ rules:
pkg_regexps:
- "github.com/krzysztofreczek/pkg/foo/.*"
component:
name: "Client of external {2} service"
name: "Client of external {1} service"
description: "foo client"
technology: "gRPC"
tags:
Expand Down

0 comments on commit d2c6076

Please sign in to comment.