Skip to content

Commit

Permalink
models: remove Point.AddField method
Browse files Browse the repository at this point in the history
AddField doesn't allow us to report errors, but we need to validate
some field names. Since we have to change the interface anyway,
we simply insist that all callers use NewPoint, rather than AddField.

Per advice from Jason Wilder, see

influxdata#5716 (comment)

Signed-off-by: Jon Seymour <jon@wildducktheories.com>
  • Loading branch information
jonseymour committed Feb 17, 2016
1 parent 20d3c96 commit 2e7d55a
Showing 1 changed file with 0 additions and 9 deletions.
9 changes: 0 additions & 9 deletions models/points.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ type Point interface {
SetTags(tags Tags)

Fields() Fields
AddField(name string, value interface{})

Time() time.Time
SetTime(t time.Time)
Expand Down Expand Up @@ -1215,14 +1214,6 @@ func (p *point) Fields() Fields {
return p.cachedFields
}

// AddField adds or replaces a field value for a point
func (p *point) AddField(name string, value interface{}) {
fields := p.Fields()
fields[name] = value
p.fields = fields.MarshalBinary()
p.cachedFields = nil
}

// SetPrecision will round a time to the specified precision
func (p *point) SetPrecision(precision string) {
switch precision {
Expand Down

0 comments on commit 2e7d55a

Please sign in to comment.