mirror of
https://github.com/dolthub/dolt.git
synced 2026-01-31 03:18:43 -06:00
35 lines
485 B
Go
35 lines
485 B
Go
package types
|
|
|
|
import (
|
|
"github.com/attic-labs/noms/ref"
|
|
)
|
|
|
|
type String struct {
|
|
s string
|
|
ref *ref.Ref
|
|
}
|
|
|
|
func NewString(s string) String {
|
|
return String{s, &ref.Ref{}}
|
|
}
|
|
|
|
func (fs String) Blob() Blob {
|
|
return NewBlob([]byte(fs.s))
|
|
}
|
|
|
|
func (fs String) String() string {
|
|
return fs.s
|
|
}
|
|
|
|
func (fs String) Ref() ref.Ref {
|
|
return ensureRef(fs.ref, fs)
|
|
}
|
|
|
|
func (fs String) Equals(other Value) bool {
|
|
if other == nil {
|
|
return false
|
|
} else {
|
|
return fs.Ref() == other.Ref()
|
|
}
|
|
}
|