add goimports format action (#3630)

Signed-off-by: Jeff <jeffzhang@yunify.com>
This commit is contained in:
zryfish
2021-03-30 13:44:24 +08:00
committed by GitHub
parent 40e3751e43
commit ac275b6e98
561 changed files with 1713 additions and 863 deletions

View File

@@ -18,14 +18,16 @@ package fake
import (
"fmt"
"github.com/emicklei/go-restful"
"io/ioutil"
v1 "k8s.io/api/core/v1"
devopsv1alpha3 "kubesphere.io/kubesphere/pkg/apis/devops/v1alpha3"
"kubesphere.io/kubesphere/pkg/simple/client/devops"
"net/http"
"net/url"
"strings"
"github.com/emicklei/go-restful"
v1 "k8s.io/api/core/v1"
devopsv1alpha3 "kubesphere.io/kubesphere/pkg/apis/devops/v1alpha3"
"kubesphere.io/kubesphere/pkg/simple/client/devops"
)
type Devops struct {

View File

@@ -18,9 +18,10 @@ package devops
import (
"fmt"
"github.com/asaskevich/govalidator"
"net/http"
"strconv"
"github.com/asaskevich/govalidator"
)
type Interface interface {

View File

@@ -17,12 +17,14 @@ package jenkins
import (
"bytes"
"errors"
"github.com/emicklei/go-restful"
"kubesphere.io/kubesphere/pkg/simple/client/devops"
"net/http"
"net/url"
"strconv"
"time"
"github.com/emicklei/go-restful"
"kubesphere.io/kubesphere/pkg/simple/client/devops"
)
const (

View File

@@ -16,13 +16,15 @@ package jenkins
import (
"errors"
"fmt"
"net/http"
"strconv"
"github.com/emicklei/go-restful"
v1 "k8s.io/api/core/v1"
"k8s.io/klog"
devopsv1alpha3 "kubesphere.io/kubesphere/pkg/apis/devops/v1alpha3"
"kubesphere.io/kubesphere/pkg/simple/client/devops"
"net/http"
"strconv"
)
const SSHCrenditalStaplerClass = "com.cloudbees.jenkins.plugins.sshcredentials.impl.BasicSSHUserPrivateKey"

View File

@@ -17,9 +17,10 @@ limitations under the License.
package jenkins
import (
"testing"
v1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"testing"
)
func TestNewUsernamePasswordCredential(t *testing.T) {

View File

@@ -1,11 +1,12 @@
package internal
import (
"github.com/beevik/etree"
"k8s.io/klog"
"strconv"
"strings"
"github.com/beevik/etree"
"k8s.io/klog"
devopsv1alpha3 "kubesphere.io/kubesphere/pkg/apis/devops/v1alpha3"
)

View File

@@ -1,10 +1,12 @@
package internal
import (
"strconv"
"github.com/beevik/etree"
"k8s.io/klog"
devopsv1alpha3 "kubesphere.io/kubesphere/pkg/apis/devops/v1alpha3"
"strconv"
)
func AppendGitSourceToEtree(source *etree.Element, gitSource *devopsv1alpha3.GitSource) {

View File

@@ -1,11 +1,13 @@
package internal
import (
"github.com/beevik/etree"
"k8s.io/klog"
devopsv1alpha3 "kubesphere.io/kubesphere/pkg/apis/devops/v1alpha3"
"strconv"
"strings"
"github.com/beevik/etree"
"k8s.io/klog"
devopsv1alpha3 "kubesphere.io/kubesphere/pkg/apis/devops/v1alpha3"
)
func AppendGithubSourceToEtree(source *etree.Element, githubSource *devopsv1alpha3.GithubSource) {

View File

@@ -1,11 +1,13 @@
package internal
import (
"github.com/beevik/etree"
"k8s.io/klog"
devopsv1alpha3 "kubesphere.io/kubesphere/pkg/apis/devops/v1alpha3"
"strconv"
"strings"
"github.com/beevik/etree"
"k8s.io/klog"
devopsv1alpha3 "kubesphere.io/kubesphere/pkg/apis/devops/v1alpha3"
)
func AppendGitlabSourceToEtree(source *etree.Element, gitSource *devopsv1alpha3.GitlabSource) {

View File

@@ -1,8 +1,9 @@
package internal
import (
"github.com/stretchr/testify/assert"
"testing"
"github.com/stretchr/testify/assert"
)
func TestPRDiscoverTrust(t *testing.T) {

View File

@@ -21,8 +21,6 @@ import (
"fmt"
"io"
"io/ioutil"
"k8s.io/klog"
"kubesphere.io/kubesphere/pkg/simple/client/devops"
"log"
"net/http"
"net/url"
@@ -30,6 +28,10 @@ import (
"reflect"
"strconv"
"strings"
"k8s.io/klog"
"kubesphere.io/kubesphere/pkg/simple/client/devops"
)
// Basic Authentication

View File

@@ -19,11 +19,12 @@ import (
"encoding/json"
"errors"
"fmt"
"kubesphere.io/kubesphere/pkg/simple/client/devops"
"net/url"
"path"
"strconv"
"strings"
"kubesphere.io/kubesphere/pkg/simple/client/devops"
)
type Job struct {

View File

@@ -18,7 +18,9 @@ package jenkins
import (
"fmt"
"github.com/spf13/pflag"
"kubesphere.io/kubesphere/pkg/utils/reflectutils"
)

View File

@@ -20,14 +20,16 @@ import (
"bytes"
"encoding/json"
"fmt"
"github.com/PuerkitoBio/goquery"
"k8s.io/klog"
"kubesphere.io/kubesphere/pkg/simple/client/devops"
"net/http"
"net/url"
"strconv"
"strings"
"time"
"github.com/PuerkitoBio/goquery"
"k8s.io/klog"
"kubesphere.io/kubesphere/pkg/simple/client/devops"
)
type Pipeline struct {

View File

@@ -18,12 +18,14 @@ package jenkins
import (
"fmt"
"github.com/beevik/etree"
devopsv1alpha3 "kubesphere.io/kubesphere/pkg/apis/devops/v1alpha3"
"kubesphere.io/kubesphere/pkg/simple/client/devops/jenkins/internal"
"strconv"
"strings"
"time"
"github.com/beevik/etree"
devopsv1alpha3 "kubesphere.io/kubesphere/pkg/apis/devops/v1alpha3"
"kubesphere.io/kubesphere/pkg/simple/client/devops/jenkins/internal"
)
func replaceXmlVersion(config, oldVersion, targetVersion string) string {

View File

@@ -17,9 +17,10 @@ limitations under the License.
package jenkins
import (
devopsv1alpha3 "kubesphere.io/kubesphere/pkg/apis/devops/v1alpha3"
"reflect"
"testing"
devopsv1alpha3 "kubesphere.io/kubesphere/pkg/apis/devops/v1alpha3"
)
func Test_NoScmPipelineConfig(t *testing.T) {

View File

@@ -2,11 +2,13 @@ package jenkins
import (
"fmt"
"github.com/stretchr/testify/assert"
"kubesphere.io/kubesphere/pkg/simple/client/devops"
"net/url"
"strconv"
"testing"
"github.com/stretchr/testify/assert"
"kubesphere.io/kubesphere/pkg/simple/client/devops"
)
func TestResetPaging(t *testing.T) {

View File

@@ -19,6 +19,7 @@ package jenkins
import (
"github.com/emicklei/go-restful"
"k8s.io/klog"
"kubesphere.io/kubesphere/pkg/simple/client/devops"
)

View File

@@ -18,11 +18,13 @@ package jenkins
import (
"fmt"
"net/http"
"github.com/emicklei/go-restful"
"k8s.io/klog"
devopsv1alpha3 "kubesphere.io/kubesphere/pkg/apis/devops/v1alpha3"
"kubesphere.io/kubesphere/pkg/simple/client/devops"
"net/http"
)
func (j *Jenkins) CreateProjectPipeline(projectId string, pipeline *devopsv1alpha3.Pipeline) (string, error) {

View File

@@ -17,11 +17,13 @@ limitations under the License.
package jenkins
import (
"k8s.io/klog"
"kubesphere.io/kubesphere/pkg/simple/client/devops"
"net/http"
"net/url"
"time"
"k8s.io/klog"
"kubesphere.io/kubesphere/pkg/simple/client/devops"
)
// TODO: deprecated, use SendJenkinsRequestWithHeaderResp() instead

View File

@@ -20,17 +20,19 @@ import (
"encoding/json"
"errors"
"fmt"
"github.com/dgrijalva/jwt-go"
"io"
"io/ioutil"
authtoken "kubesphere.io/kubesphere/pkg/apiserver/authentication/token"
"kubesphere.io/kubesphere/pkg/simple/client/devops"
"mime/multipart"
"net/http"
"net/url"
"os"
"path/filepath"
"strings"
"github.com/dgrijalva/jwt-go"
authtoken "kubesphere.io/kubesphere/pkg/apiserver/authentication/token"
"kubesphere.io/kubesphere/pkg/simple/client/devops"
)
// Request Methods

View File

@@ -18,11 +18,12 @@ package jenkins
import (
"errors"
"kubesphere.io/kubesphere/pkg/simple/client/devops"
"net/http"
"reflect"
"strconv"
"strings"
"kubesphere.io/kubesphere/pkg/simple/client/devops"
)
type GlobalRoleResponse struct {

View File

@@ -19,12 +19,13 @@ import (
"encoding/json"
"io"
"io/ioutil"
"k8s.io/klog"
"net/http"
"net/url"
"strings"
"time"
"unicode/utf8"
"k8s.io/klog"
)
func makeJson(data interface{}) string {

View File

@@ -1,9 +1,10 @@
package jenkins
import (
"github.com/stretchr/testify/assert"
"net/url"
"testing"
"github.com/stretchr/testify/assert"
)
func TestParseJenkinsQuery(t *testing.T) {

View File

@@ -2,8 +2,9 @@ package devops
import (
"fmt"
"gotest.tools/assert"
"testing"
"gotest.tools/assert"
)
func TestGetSubmitters(t *testing.T) {