From 81732006cfe081371d8a67e47408d4eae7542179 Mon Sep 17 00:00:00 2001 From: Stefan Majewsky Date: Wed, 30 May 2018 14:57:29 +0200 Subject: make the IsEqualTo() methods public --- object.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'object.go') diff --git a/object.go b/object.go index 776dd21..9140bdc 100644 --- a/object.go +++ b/object.go @@ -41,6 +41,11 @@ type Object struct { symlinkHeaders *ObjectHeaders //from HEAD/GET with ?symlink=get } +//IsEqualTo returns true if both Object instances refer to the same object. +func (o *Object) IsEqualTo(other *Object) bool { + return other.name == o.name && other.c.IsEqualTo(o.c) +} + //Object returns a handle to the object with the given name within this //container. This function does not issue any HTTP requests, and therefore cannot //ensure that the object exists. Use the Exists() function to check for the @@ -507,7 +512,7 @@ type SymlinkOptions struct { func (o *Object) SymlinkTo(target *Object, opts *SymlinkOptions, ropts *RequestOptions) error { ropts = cloneRequestOptions(ropts, nil) ropts.Headers.Set("X-Symlink-Target", target.FullName()) - if !target.c.a.isEqualTo(o.c.a) { + if !target.c.a.IsEqualTo(o.c.a) { ropts.Headers.Set("X-Symlink-Target-Account", target.c.a.Name()) } if ropts.Headers.Get("Content-Type") == "" { -- cgit v1.2.3