This is an automated email from the ASF dual-hosted git repository. kumfo pushed a commit to branch fix/connector in repository https://gitbox.apache.org/repos/asf/incubator-answer-plugins.git
commit b89b4e580a7b1f5f8348808a75d6f7cba549759f Author: kumfo <[email protected]> AuthorDate: Wed Jul 17 11:10:39 2024 +0800 fix(connector): delete not use util --- connector-apache/util.go | 53 ---------------------------------------------- connector-dingtalk/util.go | 53 ---------------------------------------------- 2 files changed, 106 deletions(-) diff --git a/connector-apache/util.go b/connector-apache/util.go deleted file mode 100644 index b120847..0000000 --- a/connector-apache/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 apache - -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-dingtalk/util.go b/connector-dingtalk/util.go deleted file mode 100644 index 6dd0d97..0000000 --- a/connector-dingtalk/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 dingtalk - -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 -}
