mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-19 18:32:23 +00:00
swarm/shed: fix typos
This commit is contained in:
parent
56a2ab76c2
commit
1e8f0ded93
4 changed files with 5 additions and 5 deletions
|
|
@ -27,7 +27,7 @@ type StringField struct {
|
|||
key []byte
|
||||
}
|
||||
|
||||
// NewStringField retruns a new Instance fo StringField.
|
||||
// NewStringField retruns a new Instance of StringField.
|
||||
// It validates its name and type against the database schema.
|
||||
func (db *DB) NewStringField(name string) (f StringField, err error) {
|
||||
key, err := db.schemaFieldKey(name, "string")
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@ func (db *DB) NewStructField(name string) (f StructField, err error) {
|
|||
}, nil
|
||||
}
|
||||
|
||||
// Unmarshal unmarshals data fromt he database to a provided val.
|
||||
// Unmarshal unmarshals data fromt the database to a provided val.
|
||||
// If the data is not found leveldb.ErrNotFound is returned.
|
||||
func (f StructField) Unmarshal(val interface{}) (err error) {
|
||||
b, err := f.db.Get(f.key)
|
||||
|
|
|
|||
|
|
@ -173,7 +173,7 @@ func (f Index) PutInBatch(batch *leveldb.Batch, i IndexItem) (err error) {
|
|||
}
|
||||
|
||||
// Delete accepts IndexItem to remove a key/value pair
|
||||
// form the database based on its fields.
|
||||
// from the database based on its fields.
|
||||
func (f Index) Delete(keyFields IndexItem) (err error) {
|
||||
key, err := f.encodeKeyFunc(keyFields)
|
||||
if err != nil {
|
||||
|
|
|
|||
|
|
@ -56,10 +56,10 @@ type indexSpec struct {
|
|||
// a particular field form the schema definition.
|
||||
func (db *DB) schemaFieldKey(name, fieldType string) (key []byte, err error) {
|
||||
if name == "" {
|
||||
return nil, errors.New("filed name can not be blank")
|
||||
return nil, errors.New("field name can not be blank")
|
||||
}
|
||||
if fieldType == "" {
|
||||
return nil, errors.New("filed type can not be blank")
|
||||
return nil, errors.New("field type can not be blank")
|
||||
}
|
||||
s, err := db.getSchema()
|
||||
if err != nil {
|
||||
|
|
|
|||
Loading…
Reference in a new issue