From b3bf9500fa993265b1fe610d3dc6535730510b4b Mon Sep 17 00:00:00 2001 From: cui fliter Date: Wed, 24 May 2023 09:57:18 +0800 Subject: [PATCH] fix function name in comments Signed-off-by: cui fliter --- src/common/http/transport.go | 4 ++-- src/lib/strings.go | 2 +- src/lib/trace/config.go | 2 +- src/pkg/reg/adapter/dockerhub/adapter.go | 2 +- src/server/middleware/repoproxy/proxy.go | 2 +- src/server/v2.0/handler/preheat.go | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/common/http/transport.go b/src/common/http/transport.go index 4724197e7d4..8cdabba2eb6 100644 --- a/src/common/http/transport.go +++ b/src/common/http/transport.go @@ -87,14 +87,14 @@ func WithInsecureSkipVerify(skipVerify bool) func(*http.Transport) { } } -// WithMaxIdleConnsPerHost returns a TransportOption that configures the transport to use the specified number of idle connections per host +// WithMaxIdleConns returns a TransportOption that configures the transport to use the specified number of idle connections per host func WithMaxIdleConns(maxIdleConns int) func(*http.Transport) { return func(tr *http.Transport) { tr.MaxIdleConns = maxIdleConns } } -// WithIdleConnTimeout returns a TransportOption that configures the transport to use the specified idle connection timeout +// WithIdleconnectionTimeout returns a TransportOption that configures the transport to use the specified idle connection timeout func WithIdleconnectionTimeout(idleConnectionTimeout time.Duration) func(*http.Transport) { return func(tr *http.Transport) { tr.IdleConnTimeout = idleConnectionTimeout diff --git a/src/lib/strings.go b/src/lib/strings.go index d50a9672e3d..9b6bbb8090f 100644 --- a/src/lib/strings.go +++ b/src/lib/strings.go @@ -21,7 +21,7 @@ import ( "golang.org/x/text/language" ) -// TrimsLineBreaks trims line breaks in string. +// TrimLineBreaks trims line breaks in string. func TrimLineBreaks(s string) string { escaped := strings.ReplaceAll(s, "\n", "") escaped = strings.ReplaceAll(escaped, "\r", "") diff --git a/src/lib/trace/config.go b/src/lib/trace/config.go index 8c69db1e8a0..d967271d8de 100644 --- a/src/lib/trace/config.go +++ b/src/lib/trace/config.go @@ -171,7 +171,7 @@ func NewConfig(opts ...Option) Config { return c } -// GetConfig returns the global configuration for trace +// GetGlobalConfig returns the global configuration for trace func GetGlobalConfig() Config { return C } diff --git a/src/pkg/reg/adapter/dockerhub/adapter.go b/src/pkg/reg/adapter/dockerhub/adapter.go index e6eeae5f81f..821bc4808b2 100644 --- a/src/pkg/reg/adapter/dockerhub/adapter.go +++ b/src/pkg/reg/adapter/dockerhub/adapter.go @@ -462,7 +462,7 @@ func (a *adapter) getTags(namespace, repo string, page, pageSize int) (*TagsResp return tags, nil } -// getFilter gets specific type filter value from filters list. +// getStringFilterValue gets specific type filter value from filters list. func (a *adapter) getStringFilterValue(filterType string, filters []*model.Filter) (string, error) { for _, f := range filters { if f.Type == filterType { diff --git a/src/server/middleware/repoproxy/proxy.go b/src/server/middleware/repoproxy/proxy.go index 084249fe61f..78e0e6c07e6 100644 --- a/src/server/middleware/repoproxy/proxy.go +++ b/src/server/middleware/repoproxy/proxy.go @@ -147,7 +147,7 @@ func defaultManifestURL(projectName string, name string, a lib.ArtifactInfo) str return fmt.Sprintf("/v2/%s/library/%s/manifests/%s", projectName, name, a.Reference) } -// defaultManifestURL return the real url for request with default project +// defaultBlobURL return the real url for request with default project func defaultBlobURL(projectName string, name string, digest string) string { return fmt.Sprintf("/v2/%s/library/%s/blobs/%s", projectName, name, digest) } diff --git a/src/server/v2.0/handler/preheat.go b/src/server/v2.0/handler/preheat.go index fe949b33673..9a8f70ad62d 100644 --- a/src/server/v2.0/handler/preheat.go +++ b/src/server/v2.0/handler/preheat.go @@ -487,7 +487,7 @@ func convertPolicyToPayload(policy *policy.Schema) (*models.PreheatPolicy, error }, nil } -// convertParamPolicyToPolicy converts params policy to pkg model policy +// convertParamPolicyToModelPolicy converts params policy to pkg model policy func convertParamPolicyToModelPolicy(model *models.PreheatPolicy) (*policy.Schema, error) { if model == nil { return nil, errors.New("policy can not be nil")