summaryrefslogtreecommitdiff
path: root/src/mongo/gotools/src/github.com/mongodb/mongo-tools/vendor/github.com/mongodb/mongo-tools-common/json/iso_date.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/gotools/src/github.com/mongodb/mongo-tools/vendor/github.com/mongodb/mongo-tools-common/json/iso_date.go')
-rw-r--r--src/mongo/gotools/src/github.com/mongodb/mongo-tools/vendor/github.com/mongodb/mongo-tools-common/json/iso_date.go51
1 files changed, 0 insertions, 51 deletions
diff --git a/src/mongo/gotools/src/github.com/mongodb/mongo-tools/vendor/github.com/mongodb/mongo-tools-common/json/iso_date.go b/src/mongo/gotools/src/github.com/mongodb/mongo-tools/vendor/github.com/mongodb/mongo-tools-common/json/iso_date.go
deleted file mode 100644
index 48410b7e37b..00000000000
--- a/src/mongo/gotools/src/github.com/mongodb/mongo-tools/vendor/github.com/mongodb/mongo-tools-common/json/iso_date.go
+++ /dev/null
@@ -1,51 +0,0 @@
-// Copyright (C) MongoDB, Inc. 2014-present.
-//
-// Licensed under the Apache License, Version 2.0 (the "License"); you may
-// not use this file except in compliance with the License. You may obtain
-// a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
-
-package json
-
-import (
- "fmt"
- "reflect"
-)
-
-// Transition functions for recognizing ISODate.
-// Adapted from encoding/json/scanner.go.
-
-// stateIS is the state after reading `IS`.
-func stateIS(s *scanner, c int) int {
- if c == 'O' {
- s.step = stateISO
- return scanContinue
- }
- return s.error(c, "in literal ISODate (expecting 'O')")
-}
-
-// stateISO is the state after reading `ISO`.
-func stateISO(s *scanner, c int) int {
- if c == 'D' {
- s.step = stateD
- return scanContinue
- }
- return s.error(c, "in literal ISODate (expecting 'D')")
-}
-
-// Decodes a ISODate literal stored in the underlying byte data into v.
-func (d *decodeState) storeISODate(v reflect.Value) {
- op := d.scanWhile(scanSkipSpace)
- if op != scanBeginCtor {
- d.error(fmt.Errorf("expected beginning of constructor"))
- }
- args, err := d.ctor("ISODate", []reflect.Type{isoDateType})
- if err != nil {
- d.error(err)
- }
- switch kind := v.Kind(); kind {
- case reflect.Interface:
- v.Set(args[0])
- default:
- d.error(fmt.Errorf("cannot store %v value into %v type", isoDateType, kind))
- }
-}