Skip to main content
Glama

protolint-mcp

by yoheimuta
testFile.go801 B
package util_test import ( "os" "strings" "github.com/yoheimuta/protolint/internal/osutil" ) // TestData is a wrapped test file. type TestData struct { FilePath string OriginData []byte } // NewTestData create a new TestData. func NewTestData( filePath string, ) (TestData, error) { data, err := os.ReadFile(filePath) if err != nil { return TestData{}, nil } return TestData{ FilePath: filePath, OriginData: data, }, nil } // Data returns a content. func (d TestData) Data() ([]byte, error) { return os.ReadFile(d.FilePath) } // Restore writes the original content back to the file. func (d TestData) Restore() error { newlineChar := "\n" lines := strings.Split(string(d.OriginData), newlineChar) return osutil.WriteLinesToExistingFile(d.FilePath, lines, newlineChar) }

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/yoheimuta/protolint'

If you have feedback or need assistance with the MCP directory API, please join our Discord server