String returns a textual representation of the SRI which will be similar to the input.
()
| 51 | |
| 52 | // String returns a textual representation of the SRI which will be similar to the input. |
| 53 | func (s *SRI) String() string { |
| 54 | str := s.Treeish |
| 55 | if len(s.Path) > 0 { |
| 56 | str += "/" + s.Path |
| 57 | } |
| 58 | if len(s.Field) > 0 { |
| 59 | str += "?" + s.Field |
| 60 | } |
| 61 | return str |
| 62 | } |
| 63 | |
| 64 | // Proto returns the protobuf representation of an SRI |
| 65 | func (s *SRI) Proto() *pb.SRI { |