github.com/grailbio/base@v0.0.11/recordio/deprecated/proto_test.go (about)

     1  // Copyright 2017 GRAIL, Inc. All rights reserved.
     2  // Use of this source code is governed by the Apache-2.0
     3  // license that can be found in the LICENSE file.
     4  
     5  package deprecated_test
     6  
     7  import "github.com/golang/protobuf/proto"
     8  
     9  // recordioUnmarshal is intended for use with recordio Scanners.
    10  func recordioUnmarshal(b []byte, v interface{}) error {
    11  	return proto.Unmarshal(b, v.(proto.Message))
    12  }
    13  
    14  // recordioMarshal is intended for use with recordio Writers.
    15  func recordioMarshal(scratch []byte, v interface{}) ([]byte, error) {
    16  	return proto.Marshal(v.(proto.Message))
    17  }