improved UnreadString
This commit is contained in:
		| @ -46,8 +46,8 @@ func (r *Reader) UnreadRune() error { | |||||||
| 	return nil | 	return nil | ||||||
| } | } | ||||||
|  |  | ||||||
| // UnreadString calls UnreadRune for each rune in str | // UnreadString calls UnreadRune for each rune in str + one addtional rune for the separator rune | ||||||
| // The actual runes are irrelevant. | // The actual runes in str are irrelevant. | ||||||
| // Only the rune count of str determines the amount of UnreadRune calls. | // Only the rune count of str determines the amount of UnreadRune calls. | ||||||
| // The first error occured will be returned immediately. | // The first error occured will be returned immediately. | ||||||
| func (r *Reader) UnreadString(str string) error { | func (r *Reader) UnreadString(str string) error { | ||||||
| @ -57,7 +57,7 @@ func (r *Reader) UnreadString(str string) error { | |||||||
| 			return err | 			return err | ||||||
| 		} | 		} | ||||||
| 	} | 	} | ||||||
| 	return nil | 	return r.UnreadRune() | ||||||
| } | } | ||||||
|  |  | ||||||
| // StringWhile reads runes and calls f for each one. | // StringWhile reads runes and calls f for each one. | ||||||
|  | |||||||
		Reference in New Issue
	
	Block a user
	 Timon Ringwald
					Timon Ringwald