You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: cloudrunci.go
    path of file: ./repos/golang-samples/internal/cloudrunci
    
    the code of the file until where you have to start completion: // Copyright 2019 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in complia
    
func (s *Service) Clean() error {
	// NOTE: don't check whether p.deployed is set.
	// We may want to attempt to clean up if deployment failed.

	if err := s.validate(); err != nil {
		return err
	}

	if _, err := gcloud(s.operationLabel(labelOperationDeleteService), s.deleteServiceCmd()); err != nil {
		return fmt.Errorf("gcloud: %v: %q", s.version(), err)
	}
	s.deployed = false

	// If s.built is false no image was created or is not managed by cloudrun-ci.
	if s.built {
		_, err := gcloud(s.operationLabel("delete container image"), s.deleteImageCmd())
		if err != nil {
			return fmt.Errorf("gcloud: %v: %q", s.version(), err)
		}
		s.built = false
	}

	return nil
}