This is an automated email from the ASF dual-hosted git repository. kumfo pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/incubator-answer-plugins.git
commit c6848162eb4e3b51e4a629d4172f8fdc838c1592 Author: kumfo <[email protected]> AuthorDate: Wed Jul 10 11:29:56 2024 +0800 chore(rebase): rebase from main --- connector-basic/util.go | 53 -------------------------------------------- connector-github/util.go | 53 -------------------------------------------- connector-google/util.go | 53 -------------------------------------------- editor-chart/util.go | 53 -------------------------------------------- editor-formula/util.go | 53 -------------------------------------------- embed-basic/basic.go | 5 +---- embed-basic/util.go | 53 -------------------------------------------- notification-slack/util.go | 53 -------------------------------------------- reviewer-akismet/go.mod | 2 -- reviewer-akismet/util.go | 53 -------------------------------------------- reviewer-basic/util.go | 53 -------------------------------------------- search-algolia/util.go | 53 -------------------------------------------- search-elasticsearch/util.go | 53 -------------------------------------------- search-meilisearch/util.go | 53 -------------------------------------------- storage-aliyunoss/util.go | 53 -------------------------------------------- storage-s3/util.go | 53 -------------------------------------------- user-center-wecom/go.mod | 1 - user-center-wecom/util.go | 53 -------------------------------------------- 18 files changed, 1 insertion(+), 802 deletions(-) diff --git a/connector-basic/util.go b/connector-basic/util.go deleted file mode 100644 index bc94b41..0000000 --- a/connector-basic/util.go +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package basic - -import ( - "fmt" - "os" - "path/filepath" - "runtime" - - "gopkg.in/yaml.v2" -) - -type Info struct { - SlugName string `yaml:"slug_name"` - Type string `yaml:"type"` - Version string `yaml:"version"` - Author string `yaml:"author"` - Link string `yaml:"link"` -} - -func (c *Info) getInfo() *Info { - _, filename, _, _ := runtime.Caller(0) - wd := filepath.Dir(filename) - - yamlFilePath := filepath.Join(wd, "info.yaml") - yamlFile, err := os.ReadFile(yamlFilePath) - if err != nil { - fmt.Println(err) - } - err = yaml.Unmarshal(yamlFile, c) - if err != nil { - fmt.Println(err) - } - return c -} diff --git a/connector-github/util.go b/connector-github/util.go deleted file mode 100644 index cd2b9a2..0000000 --- a/connector-github/util.go +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package github - -import ( - "fmt" - "os" - "path/filepath" - "runtime" - - "gopkg.in/yaml.v2" -) - -type Info struct { - SlugName string `yaml:"slug_name"` - Type string `yaml:"type"` - Version string `yaml:"version"` - Author string `yaml:"author"` - Link string `yaml:"link"` -} - -func (c *Info) getInfo() *Info { - _, filename, _, _ := runtime.Caller(0) - wd := filepath.Dir(filename) - - yamlFilePath := filepath.Join(wd, "info.yaml") - yamlFile, err := os.ReadFile(yamlFilePath) - if err != nil { - fmt.Println(err) - } - err = yaml.Unmarshal(yamlFile, c) - if err != nil { - fmt.Println(err) - } - return c -} diff --git a/connector-google/util.go b/connector-google/util.go deleted file mode 100644 index e0d1a79..0000000 --- a/connector-google/util.go +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package google - -import ( - "fmt" - "os" - "path/filepath" - "runtime" - - "gopkg.in/yaml.v2" -) - -type Info struct { - SlugName string `yaml:"slug_name"` - Type string `yaml:"type"` - Version string `yaml:"version"` - Author string `yaml:"author"` - Link string `yaml:"link"` -} - -func (c *Info) getInfo() *Info { - _, filename, _, _ := runtime.Caller(0) - wd := filepath.Dir(filename) - - yamlFilePath := filepath.Join(wd, "info.yaml") - yamlFile, err := os.ReadFile(yamlFilePath) - if err != nil { - fmt.Println(err) - } - err = yaml.Unmarshal(yamlFile, c) - if err != nil { - fmt.Println(err) - } - return c -} diff --git a/editor-chart/util.go b/editor-chart/util.go deleted file mode 100644 index a72cd4d..0000000 --- a/editor-chart/util.go +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package chart - -import ( - "fmt" - "os" - "path/filepath" - "runtime" - - "gopkg.in/yaml.v2" -) - -type Info struct { - SlugName string `yaml:"slug_name"` - Type string `yaml:"type"` - Version string `yaml:"version"` - Author string `yaml:"author"` - Link string `yaml:"link"` -} - -func (c *Info) getInfo() *Info { - _, filename, _, _ := runtime.Caller(0) - wd := filepath.Dir(filename) - - yamlFilePath := filepath.Join(wd, "info.yaml") - yamlFile, err := os.ReadFile(yamlFilePath) - if err != nil { - fmt.Println(err) - } - err = yaml.Unmarshal(yamlFile, c) - if err != nil { - fmt.Println(err) - } - return c -} diff --git a/editor-formula/util.go b/editor-formula/util.go deleted file mode 100644 index fb3b23f..0000000 --- a/editor-formula/util.go +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package formula - -import ( - "fmt" - "os" - "path/filepath" - "runtime" - - "gopkg.in/yaml.v2" -) - -type Info struct { - SlugName string `yaml:"slug_name"` - Type string `yaml:"type"` - Version string `yaml:"version"` - Author string `yaml:"author"` - Link string `yaml:"link"` -} - -func (c *Info) getInfo() *Info { - _, filename, _, _ := runtime.Caller(0) - wd := filepath.Dir(filename) - - yamlFilePath := filepath.Join(wd, "info.yaml") - yamlFile, err := os.ReadFile(yamlFilePath) - if err != nil { - fmt.Println(err) - } - err = yaml.Unmarshal(yamlFile, c) - if err != nil { - fmt.Println(err) - } - return c -} diff --git a/embed-basic/basic.go b/embed-basic/basic.go index 7be156f..409ea55 100644 --- a/embed-basic/basic.go +++ b/embed-basic/basic.go @@ -156,7 +156,4 @@ func (e *Embed) ConfigFields() []plugin.ConfigField { func (e *Embed) ConfigReceiver(config []byte) error { c := &EmbedConfig{} - _ = json.Unmarshal(config, c) - e.Config = c - return nil -} + _ \ No newline at end of file diff --git a/embed-basic/util.go b/embed-basic/util.go deleted file mode 100644 index 1423319..0000000 --- a/embed-basic/util.go +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package embed_basic - -import ( - "fmt" - "os" - "path/filepath" - "runtime" - - "gopkg.in/yaml.v2" -) - -type Info struct { - SlugName string `yaml:"slug_name"` - Type string `yaml:"type"` - Version string `yaml:"version"` - Author string `yaml:"author"` - Link string `yaml:"link"` -} - -func (c *Info) getInfo() *Info { - _, filename, _, _ := runtime.Caller(0) - wd := filepath.Dir(filename) - - yamlFilePath := filepath.Join(wd, "info.yaml") - yamlFile, err := os.ReadFile(yamlFilePath) - if err != nil { - fmt.Println(err) - } - err = yaml.Unmarshal(yamlFile, c) - if err != nil { - fmt.Println(err) - } - return c -} diff --git a/notification-slack/util.go b/notification-slack/util.go deleted file mode 100644 index f6ad858..0000000 --- a/notification-slack/util.go +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package slack - -import ( - "fmt" - "os" - "path/filepath" - "runtime" - - "gopkg.in/yaml.v2" -) - -type Info struct { - SlugName string `yaml:"slug_name"` - Type string `yaml:"type"` - Version string `yaml:"version"` - Author string `yaml:"author"` - Link string `yaml:"link"` -} - -func (c *Info) getInfo() *Info { - _, filename, _, _ := runtime.Caller(0) - wd := filepath.Dir(filename) - - yamlFilePath := filepath.Join(wd, "info.yaml") - yamlFile, err := os.ReadFile(yamlFilePath) - if err != nil { - fmt.Println(err) - } - err = yaml.Unmarshal(yamlFile, c) - if err != nil { - fmt.Println(err) - } - return c -} diff --git a/reviewer-akismet/go.mod b/reviewer-akismet/go.mod index b963030..7dce98c 100644 --- a/reviewer-akismet/go.mod +++ b/reviewer-akismet/go.mod @@ -4,10 +4,8 @@ go 1.19 require ( github.com/apache/incubator-answer v1.3.1-0.20240506084933-9681c026adfe - github.com/apache/incubator-answer-plugins/util v0.0.0-00010101000000-000000000000 github.com/go-resty/resty/v2 v2.12.0 github.com/segmentfault/pacman v1.0.5-0.20230822083413-c0075a2d401f - gopkg.in/yaml.v2 v2.4.0 ) require ( diff --git a/reviewer-akismet/util.go b/reviewer-akismet/util.go deleted file mode 100644 index bc94b41..0000000 --- a/reviewer-akismet/util.go +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package basic - -import ( - "fmt" - "os" - "path/filepath" - "runtime" - - "gopkg.in/yaml.v2" -) - -type Info struct { - SlugName string `yaml:"slug_name"` - Type string `yaml:"type"` - Version string `yaml:"version"` - Author string `yaml:"author"` - Link string `yaml:"link"` -} - -func (c *Info) getInfo() *Info { - _, filename, _, _ := runtime.Caller(0) - wd := filepath.Dir(filename) - - yamlFilePath := filepath.Join(wd, "info.yaml") - yamlFile, err := os.ReadFile(yamlFilePath) - if err != nil { - fmt.Println(err) - } - err = yaml.Unmarshal(yamlFile, c) - if err != nil { - fmt.Println(err) - } - return c -} diff --git a/reviewer-basic/util.go b/reviewer-basic/util.go deleted file mode 100644 index bc94b41..0000000 --- a/reviewer-basic/util.go +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package basic - -import ( - "fmt" - "os" - "path/filepath" - "runtime" - - "gopkg.in/yaml.v2" -) - -type Info struct { - SlugName string `yaml:"slug_name"` - Type string `yaml:"type"` - Version string `yaml:"version"` - Author string `yaml:"author"` - Link string `yaml:"link"` -} - -func (c *Info) getInfo() *Info { - _, filename, _, _ := runtime.Caller(0) - wd := filepath.Dir(filename) - - yamlFilePath := filepath.Join(wd, "info.yaml") - yamlFile, err := os.ReadFile(yamlFilePath) - if err != nil { - fmt.Println(err) - } - err = yaml.Unmarshal(yamlFile, c) - if err != nil { - fmt.Println(err) - } - return c -} diff --git a/search-algolia/util.go b/search-algolia/util.go deleted file mode 100644 index aa97402..0000000 --- a/search-algolia/util.go +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package algolia - -import ( - "fmt" - "os" - "path/filepath" - "runtime" - - "gopkg.in/yaml.v2" -) - -type Info struct { - SlugName string `yaml:"slug_name"` - Type string `yaml:"type"` - Version string `yaml:"version"` - Author string `yaml:"author"` - Link string `yaml:"link"` -} - -func (c *Info) getInfo() *Info { - _, filename, _, _ := runtime.Caller(0) - wd := filepath.Dir(filename) - - yamlFilePath := filepath.Join(wd, "info.yaml") - yamlFile, err := os.ReadFile(yamlFilePath) - if err != nil { - fmt.Println(err) - } - err = yaml.Unmarshal(yamlFile, c) - if err != nil { - fmt.Println(err) - } - return c -} diff --git a/search-elasticsearch/util.go b/search-elasticsearch/util.go deleted file mode 100644 index 23fc202..0000000 --- a/search-elasticsearch/util.go +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package es - -import ( - "fmt" - "os" - "path/filepath" - "runtime" - - "gopkg.in/yaml.v2" -) - -type Info struct { - SlugName string `yaml:"slug_name"` - Type string `yaml:"type"` - Version string `yaml:"version"` - Author string `yaml:"author"` - Link string `yaml:"link"` -} - -func (c *Info) getInfo() *Info { - _, filename, _, _ := runtime.Caller(0) - wd := filepath.Dir(filename) - - yamlFilePath := filepath.Join(wd, "info.yaml") - yamlFile, err := os.ReadFile(yamlFilePath) - if err != nil { - fmt.Println(err) - } - err = yaml.Unmarshal(yamlFile, c) - if err != nil { - fmt.Println(err) - } - return c -} diff --git a/search-meilisearch/util.go b/search-meilisearch/util.go deleted file mode 100644 index 881a139..0000000 --- a/search-meilisearch/util.go +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package meilisearch - -import ( - "fmt" - "os" - "path/filepath" - "runtime" - - "gopkg.in/yaml.v2" -) - -type Info struct { - SlugName string `yaml:"slug_name"` - Type string `yaml:"type"` - Version string `yaml:"version"` - Author string `yaml:"author"` - Link string `yaml:"link"` -} - -func (c *Info) getInfo() *Info { - _, filename, _, _ := runtime.Caller(0) - wd := filepath.Dir(filename) - - yamlFilePath := filepath.Join(wd, "info.yaml") - yamlFile, err := os.ReadFile(yamlFilePath) - if err != nil { - fmt.Println(err) - } - err = yaml.Unmarshal(yamlFile, c) - if err != nil { - fmt.Println(err) - } - return c -} diff --git a/storage-aliyunoss/util.go b/storage-aliyunoss/util.go deleted file mode 100644 index bbb04de..0000000 --- a/storage-aliyunoss/util.go +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package aliyunoss - -import ( - "fmt" - "os" - "path/filepath" - "runtime" - - "gopkg.in/yaml.v2" -) - -type Info struct { - SlugName string `yaml:"slug_name"` - Type string `yaml:"type"` - Version string `yaml:"version"` - Author string `yaml:"author"` - Link string `yaml:"link"` -} - -func (c *Info) getInfo() *Info { - _, filename, _, _ := runtime.Caller(0) - wd := filepath.Dir(filename) - - yamlFilePath := filepath.Join(wd, "info.yaml") - yamlFile, err := os.ReadFile(yamlFilePath) - if err != nil { - fmt.Println(err) - } - err = yaml.Unmarshal(yamlFile, c) - if err != nil { - fmt.Println(err) - } - return c -} diff --git a/storage-s3/util.go b/storage-s3/util.go deleted file mode 100644 index 317929a..0000000 --- a/storage-s3/util.go +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package s3 - -import ( - "fmt" - "os" - "path/filepath" - "runtime" - - "gopkg.in/yaml.v2" -) - -type Info struct { - SlugName string `yaml:"slug_name"` - Type string `yaml:"type"` - Version string `yaml:"version"` - Author string `yaml:"author"` - Link string `yaml:"link"` -} - -func (c *Info) getInfo() *Info { - _, filename, _, _ := runtime.Caller(0) - wd := filepath.Dir(filename) - - yamlFilePath := filepath.Join(wd, "info.yaml") - yamlFile, err := os.ReadFile(yamlFilePath) - if err != nil { - fmt.Println(err) - } - err = yaml.Unmarshal(yamlFile, c) - if err != nil { - fmt.Println(err) - } - return c -} diff --git a/user-center-wecom/go.mod b/user-center-wecom/go.mod index 7a49e98..06f65fa 100644 --- a/user-center-wecom/go.mod +++ b/user-center-wecom/go.mod @@ -11,7 +11,6 @@ require ( github.com/segmentfault/pacman v1.0.5-0.20230822083413-c0075a2d401f github.com/silenceper/wechat/v2 v2.1.6 github.com/tidwall/gjson v1.14.4 - gopkg.in/yaml.v2 v2.4.0 ) require ( diff --git a/user-center-wecom/util.go b/user-center-wecom/util.go deleted file mode 100644 index 866016b..0000000 --- a/user-center-wecom/util.go +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package wecom - -import ( - "fmt" - "os" - "path/filepath" - "runtime" - - "gopkg.in/yaml.v2" -) - -type Info struct { - SlugName string `yaml:"slug_name"` - Type string `yaml:"type"` - Version string `yaml:"version"` - Author string `yaml:"author"` - Link string `yaml:"link"` -} - -func (c *Info) getInfo() *Info { - _, filename, _, _ := runtime.Caller(0) - wd := filepath.Dir(filename) - - yamlFilePath := filepath.Join(wd, "info.yaml") - yamlFile, err := os.ReadFile(yamlFilePath) - if err != nil { - fmt.Println(err) - } - err = yaml.Unmarshal(yamlFile, c) - if err != nil { - fmt.Println(err) - } - return c -}
