chore(plugin): remove sample

This commit is contained in:
LinkinStars 2023-03-27 13:37:32 +08:00
parent 689297e14d
commit 072bf002c2
2 changed files with 0 additions and 46 deletions

View File

@ -1,20 +0,0 @@
package sample
import "github.com/answerdev/answer/plugin"
type Connector struct {
}
func init() {
plugin.Register(&Connector{})
}
func (c *Connector) Info() plugin.Info {
return plugin.Info{
Name: plugin.MakeTranslator("plugin.connector.name"),
SlugName: "connector",
//Description: plugin.MakeTranslator("plugin.connector.description"),
Author: "answerdev",
Version: "0.0.1",
}
}

View File

@ -1,26 +0,0 @@
package sample
import (
"fmt"
"net/http"
"net/http/httptest"
"testing"
"github.com/answerdev/answer/plugin"
"github.com/gin-gonic/gin"
)
func TestConnector_Info(t *testing.T) {
c, _ := gin.CreateTestContext(httptest.NewRecorder())
c.Request, _ = http.NewRequest("", "", nil)
c.Request.Header.Set("Accept-Language", "en_US")
_ = plugin.CallBase(func(base plugin.Base) error {
info := base.Info()
fmt.Println(info.Name.Translate(c))
fmt.Println(info.SlugName)
fmt.Println(info.Description.Translate(c))
fmt.Println(info.Author)
fmt.Println(info.Version)
return nil
})
}