id stringlengths 2 7 | text stringlengths 17 51.2k | title stringclasses 1 value |
|---|---|---|
c171700 | data}
e.UnmarshalEasyJSON(&l)
return l.Error()
} | |
c171701 | := in.String(); in.Ok() {
*e = Email(data)
}
} | |
c171702 | return nil
}
return errors.New("couldn't unmarshal bson raw value as Email")
} | |
c171703 | := new(Email)
e.DeepCopyInto(out)
return out
} | |
c171704 | *jwriter.Writer) {
w.String(string(h))
} | |
c171705 | return nil
}
return errors.New("couldn't unmarshal bson raw value as Hostname")
} | |
c171706 | := new(Hostname)
h.DeepCopyInto(out)
return out
} | |
c171707 | *jwriter.Writer) {
w.String(string(u))
} | |
c171708 | := new(IPv4)
u.DeepCopyInto(out)
return out
} | |
c171709 | *jwriter.Writer) {
w.String(string(u))
} | |
c171710 | := new(IPv6)
u.DeepCopyInto(out)
return out
} | |
c171711 | *jwriter.Writer) {
w.String(string(u))
} | |
c171712 | := new(CIDR)
u.DeepCopyInto(out)
return out
} | |
c171713 | *jwriter.Writer) {
w.String(string(u))
} | |
c171714 | new(MAC)
u.DeepCopyInto(out)
return out
} | |
c171715 | *jwriter.Writer) {
w.String(string(u))
} | |
c171716 | return nil
}
return errors.New("couldn't unmarshal bson raw value as UUID")
} | |
c171717 | := new(UUID)
u.DeepCopyInto(out)
return out
} | |
c171718 |
w.String(string(u))
} | |
c171719 | := new(UUID3)
u.DeepCopyInto(out)
return out
} | |
c171720 |
w.String(string(u))
} | |
c171721 | l := jlexer.Lexer{Data: data}
u.UnmarshalEasyJSON(&l)
return l.Error()
} | |
c171722 | := new(UUID4)
u.DeepCopyInto(out)
return out
} | |
c171723 |
w.String(string(u))
} | |
c171724 | := new(UUID5)
u.DeepCopyInto(out)
return out
} | |
c171725 | *jwriter.Writer) {
w.String(string(u))
} | |
c171726 | := new(ISBN)
u.DeepCopyInto(out)
return out
} | |
c171727 |
w.String(string(u))
} | |
c171728 | := in.String(); in.Ok() {
*u = ISBN10(data)
}
} | |
c171729 | := new(ISBN10)
u.DeepCopyInto(out)
return out
} | |
c171730 |
w.String(string(u))
} | |
c171731 | := new(ISBN13)
u.DeepCopyInto(out)
return out
} | |
c171732 | *jwriter.Writer) {
w.String(string(u))
} | |
c171733 | out := new(CreditCard)
u.DeepCopyInto(out)
return out
} | |
c171734 | *jwriter.Writer) {
w.String(string(u))
} | |
c171735 | new(SSN)
u.DeepCopyInto(out)
return out
} | |
c171736 | jwriter.Writer
h.MarshalEasyJSON(&w)
return w.BuildBytes()
} | |
c171737 | *jwriter.Writer) {
w.String(string(h))
} | |
c171738 | {
l := jlexer.Lexer{Data: data}
h.UnmarshalEasyJSON(&l)
return l.Error()
} | |
c171739 | := in.String(); in.Ok() {
*h = HexColor(data)
}
} | |
c171740 | := new(HexColor)
h.DeepCopyInto(out)
return out
} | |
c171741 | *jwriter.Writer) {
w.String(string(r))
} | |
c171742 | {
l := jlexer.Lexer{Data: data}
r.UnmarshalEasyJSON(&l)
return l.Error()
} | |
c171743 | := in.String(); in.Ok() {
*r = RGBColor(data)
}
} | |
c171744 | := new(RGBColor)
r.DeepCopyInto(out)
return out
} | |
c171745 | jwriter.Writer
r.MarshalEasyJSON(&w)
return w.BuildBytes()
} | |
c171746 | *jwriter.Writer) {
w.String(string(r))
} | |
c171747 | return nil
}
return errors.New("couldn't unmarshal bson raw value as Password")
} | |
c171748 | := new(Password)
r.DeepCopyInto(out)
return out
} | |
c171749 | || len(matches[0]) == 0 {
return false
}
m := matches[0]
res := m[1] <= "23" && m[2] <= "59" && m[3] <= "59"
return res
} | |
c171750 |
lastError = err
continue
}
lastError = nil
return DateTime(dd), nil
}
return DateTime{}, lastError
} | |
c171751 | err != nil {
return err
}
*t = tt
return nil
} | |
c171752 |
*t = DateTime{}
default:
return fmt.Errorf("cannot sql.Scan() strfmt.DateTime from: %#v", v)
}
return nil
} | |
c171753 | driver.Value(t.String()), nil
} | |
c171754 | jwriter.Writer
t.MarshalEasyJSON(&w)
return w.BuildBytes()
} | |
c171755 | w.String(time.Time(t).Format(MarshalFormat))
} | |
c171756 |
l := jlexer.Lexer{Data: data}
t.UnmarshalEasyJSON(&l)
return l.Error()
} | |
c171757 | if err != nil {
in.AddError(err)
return
}
*t = tt
}
} | |
c171758 | err = ParseDateTime(data)
return err
}
return errors.New("couldn't unmarshal bson raw value as Duration")
} | |
c171759 | := new(DateTime)
t.DeepCopyInto(out)
return out
} | |
c171760 | ParseDuration(str)
return err == nil
} | |
c171761 |
for i, variant := range variants {
if (last == i && strings.HasPrefix(unit, variant)) || strings.EqualFold(variant, unit) {
ok = true
dur += (time.Duration(factor) * multiplier)
}
}
}
}
if ok {
return dur, nil
}
return 0, fmt.Errorf("unable to parse %s as duration", cand)
} | |
c171762 | default:
return fmt.Errorf("cannot sql.Scan() strfmt.Duration from: %#v", v)
}
return nil
} | |
c171763 | driver.Value(int64(d)), nil
} | |
c171764 | jwriter.Writer
d.MarshalEasyJSON(&w)
return w.BuildBytes()
} | |
c171765 | w.String(time.Duration(d).String())
} | |
c171766 | {
l := jlexer.Lexer{Data: data}
d.UnmarshalEasyJSON(&l)
return l.Error()
} | |
c171767 | if err != nil {
in.AddError(err)
return
}
*d = Duration(tt)
}
} | |
c171768 | return nil
}
return errors.New("couldn't unmarshal bson raw value as Duration")
} | |
c171769 | := new(Duration)
d.DeepCopyInto(out)
return out
} | |
c171770 | return strfmt.Date{}
}
return *v
} | |
c171771 | := time.Parse(RFC3339FullDate, str)
return err == nil
} | |
c171772 | if err != nil {
return err
}
*d = Date(dd)
return nil
} | |
c171773 | *d = Date{}
return nil
default:
return fmt.Errorf("cannot sql.Scan() strfmt.Date from: %#v", v)
}
} | |
c171774 | driver.Value(d.String()), nil
} | |
c171775 | w.String(time.Time(d).Format(RFC3339FullDate))
} | |
c171776 | l := jlexer.Lexer{Data: data}
d.UnmarshalEasyJSON(&l)
return l.Error()
} | |
c171777 | if err != nil {
in.AddError(err)
return
}
*d = Date(tt)
}
} | |
c171778 | ok := m["data"].(string); ok {
rd, err := time.Parse(RFC3339FullDate, data)
*d = Date(rd)
return err
}
return errors.New("couldn't unmarshal bson raw value as Date")
} | |
c171779 | := new(Date)
d.DeepCopyInto(out)
return out
} | |
c171780 | return strfmt.DateTime{}
}
return *v
} | |
c171781 |
d := append([]knownFormat(nil), seeds...)
return &defaultFormats{
data: d,
normalizeName: normalizer,
}
} | |
c171782 | v.Validator = validator
return false
}
}
// turns out it's new after all
f.data = append(f.data, knownFormat{Name: nme, OrigName: name, Type: tpe, Validator: validator})
return true
} | |
c171783 | range f.data {
if v.Name == nme {
return v.Type, true
}
}
return nil, false
} | |
c171784 | = knownFormat{} // release
f.data = append(f.data[:i], f.data[i+1:]...)
return true
}
}
return false
} | |
c171785 | if v.Type == tpe {
f.data[i] = knownFormat{} // release
f.data = append(f.data[:i], f.data[i+1:]...)
return true
}
}
return false
} | |
c171786 | range f.data {
if v.Name == nme {
return true
}
}
return false
} | |
c171787 | if tpe.Kind() == reflect.Ptr {
tpe = tpe.Elem()
}
for _, v := range f.data {
if v.Type == tpe {
return true
}
}
return false
} | |
c171788 | err != nil {
return nil, err
}
return nw, nil
}
return nil, errors.InvalidTypeName(name)
}
}
return nil, errors.InvalidTypeName(name)
} | |
c171789 | := make(chan string, channelBuffer)
go runFilter(f, Arg{In: in, Out: c}, e)
in = c
}
for s := range in {
arg.Out <- s
}
return e.getError()
})
} | |
c171790 | string) {
result = append(result, s)
})
if err != nil {
result = nil // Discard results on error
}
return result, err
} | |
c171791 | range items {
arg.Out <- s
}
return nil
})
} | |
c171792 | i < n; i++ {
arg.Out <- s
}
return nil
})
} | |
c171793 | {
for i := x; i <= y; i++ {
arg.Out <- fmt.Sprint(i)
}
return nil
})
} | |
c171794 | {
arg.Out <- s
}
last = s
first = false
}
return nil
})
} | |
c171795 | current = s
}
count++
}
if count > 0 {
arg.Out <- fmt.Sprintf("%d %s", count, current)
}
return nil
})
} | |
c171796 | i := len(data) - 1; i >= 0; i-- {
arg.Out <- data[i]
}
return nil
})
} | |
c171797 | } else {
j := r.Intn(i + 1)
if j < n {
reservoir[j] = s
}
}
i++
}
for _, s := range reservoir {
arg.Out <- s
}
return nil
})
} | |
c171798 |
break
}
arg.Out <- s
seen++
}
return nil
})
} | |
c171799 | !r.empty() {
arg.Out <- r.popFront()
}
return nil
})
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.