func (s *SyncStore) UpdatePuppy(puppy Puppy) error {
	if puppy.Value < 0 {
		return NewError(ErrInvalid, "value of puppy is negative")
	}
	s.Lock()
	defer s.Unlock()
	if _, exists := s.store.Load(puppy.ID); !exists {
		return NewError(ErrNotFound, fmt.Sprintf("puppy with id: %v is not found", puppy.ID))
	}
	s.store.Store(puppy.ID, &puppy)
	return nil
}
UpdatePuppy update puppy with given id in store if puppy exists
Returns nil if puppy with given id exists. Otherwise returns an error
package main
import (
	"fmt"
	"sync"
)
type SyncStore struct {
	store sync.Map
	sync.Mutex
	nextID uint64
}
func NewSyncStore() *SyncStore {
	return &SyncStore{nextID: 1, store: sync.Map{}}
}
func (s *SyncStore) CreatePuppy(puppy Puppy) (uint64, error) {
	if puppy.Value < 0 {
		return 0, NewError(ErrInvalid, "value of puppy is negative")
	}
	s.Lock()
	defer s.Unlock()
	puppy.ID = s.nextID
	s.nextID++
	s.store.Store(puppy.ID, &puppy)
	return puppy.ID, nil
}
func (s *SyncStore) ReadPuppy(id uint64) (Puppy, error) {
	value, exists := s.store.Load(id)
	if !exists {
		return Puppy{}, NewError(ErrNotFound, fmt.Sprintf("puppy with id: %v is not found", id))
	}
	return *value.(*Puppy), nil
}