Copy makes a fully independent copy of a profile.
()
| 863 | |
| 864 | // Copy makes a fully independent copy of a profile. |
| 865 | func (p *Profile) Copy() *Profile { |
| 866 | pp := &Profile{} |
| 867 | if err := unmarshal(serialize(p), pp); err != nil { |
| 868 | panic(err) |
| 869 | } |
| 870 | if err := pp.postDecode(); err != nil { |
| 871 | panic(err) |
| 872 | } |
| 873 | |
| 874 | return pp |
| 875 | } |