Skip to content

Commit 1f52ae4

Browse files
author
joeybloggs
committed
Renamed GroupWithExisting to Group
- GroupWithExisting wa too long for a default behaviour function. - Updated README version as this is a breaking change.
1 parent f99674a commit 1f52ae4

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
##Pure
22
<img align="right" src="https://raw.githubusercontent.com/go-playground/pure/master/logo.png">
3-
![Project status](https://img.shields.io/badge/version-3.1.1-green.svg)
3+
![Project status](https://img.shields.io/badge/version-4.0.0-green.svg)
44
[![Build Status](https://semaphoreci.com/api/v1/joeybloggs/pure/branches/master/badge.svg)](https://semaphoreci.com/joeybloggs/pure)
55
[![Coverage Status](https://coveralls.io/repos/github/go-playground/pure/badge.svg?branch=master)](https://coveralls.io/github/go-playground/pure?branch=master)
66
[![Go Report Card](https://goreportcard.com/badge/github.com/go-playground/pure)](https://goreportcard.com/report/github.com/go-playground/pure)

group.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ type IRouteGroup interface {
1111
IRoutes
1212
GroupWithNone(prefix string) IRouteGroup
1313
GroupWithMore(prefix string, middleware ...Middleware) IRouteGroup
14-
GroupWithExisting(prefix string) IRouteGroup
14+
Group(prefix string) IRouteGroup
1515
}
1616

1717
// IRoutes interface for routes
@@ -167,8 +167,8 @@ func (g *routeGroup) GroupWithMore(prefix string, middleware ...Middleware) IRou
167167
return rg
168168
}
169169

170-
// GroupWithExisting creates a new sub router with specified prefix and retains existing middleware.
171-
func (g *routeGroup) GroupWithExisting(prefix string) IRouteGroup {
170+
// Group creates a new sub router with specified prefix and retains existing middleware.
171+
func (g *routeGroup) Group(prefix string) IRouteGroup {
172172

173173
rg := &routeGroup{
174174
prefix: g.prefix + prefix,

group_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ func TestUseAndGroup(t *testing.T) {
4646
Equal(t, body, http.MethodGet)
4747
Equal(t, log, "/")
4848

49-
g := p.GroupWithExisting("/users")
49+
g := p.Group("/users")
5050
g.Get("/", fn)
5151
g.Get("/list/", fn)
5252

@@ -81,7 +81,7 @@ func TestUseAndGroup(t *testing.T) {
8181
Equal(t, body, http.MethodGet)
8282
Equal(t, log, "/superheros/list/2")
8383

84-
sc := sh.GroupWithExisting("/children")
84+
sc := sh.Group("/children")
8585
sc.Get("/", fn)
8686
sc.Get("/list/", fn)
8787

0 commit comments

Comments
 (0)