| OLD | NEW |
| (Empty) | |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 package git |
| 6 |
| 7 import ( |
| 8 "fmt" |
| 9 ) |
| 10 |
| 11 // Types /////////////////////////////////////////////////////////////////////// |
| 12 |
| 13 // Child is an entry in a Tree. It ties a Mode to an Object. |
| 14 type Child struct { |
| 15 Object Object |
| 16 Mode Mode |
| 17 } |
| 18 |
| 19 // Constructors /////////////////////////////////////////////////////////////// |
| 20 |
| 21 // NewEmptyChild returns a Child containing an EmptyObject of id. |
| 22 func NewEmptyChild(mode Mode, id Identifiable) (*Child, error) { |
| 23 o, err := NewEmptyObjectErr(mode.Type(), id) |
| 24 if err != nil { |
| 25 return nil, err |
| 26 } |
| 27 return &Child{o, mode}, nil |
| 28 } |
| 29 |
| 30 // Member functions //////////////////////////////////////////////////////////// |
| 31 |
| 32 func (c Child) String() string { |
| 33 return fmt.Sprintf("Child(%s, %s)", c.Object, c.Mode) |
| 34 } |
| OLD | NEW |