Skip to content

Commit

Permalink
notify: remove String() method from EventInfo interface (fixes #57)
Browse files Browse the repository at this point in the history
  • Loading branch information
Pawel Knap committed Feb 12, 2015
1 parent 54473ba commit a0545da
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
3 changes: 1 addition & 2 deletions event.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,10 @@ func (e Event) String() string {
type EventInfo interface {
Event() Event // single event of the file
Path() string // real path of the file
String() string // #57
Sys() interface{} // underlying data source (can return nil)
}

// String implements EventInfo interface.
// String implements fmt.Stringer interface.
func (e *event) String() string {
return e.Event().String() + `, "` + e.Path() + `"`
}
Expand Down
14 changes: 10 additions & 4 deletions event_stub.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,16 @@ const (

var osestr = map[Event]string{}

var ekind = map[Event]Event{
Move: Create,
}
var ekind = map[Event]Event{}

const notImplemented = "notify: not implemented"

type event struct{}

func (e *event) Event() Event { return Error }
func (e *event) Path() string { return notImplemented }
func (e *event) Sys() interface{} { return nil }

func isdir(EventInfo) (bool, error) {
return false, errors.New("not implemented")
return false, errors.New(notImplemented)
}

0 comments on commit a0545da

Please sign in to comment.