Skip to content

Instantly share code, notes, and snippets.

View yakuter's full-sized avatar
💭
Working #golang @binalyze

Erhan Yakut yakuter

💭
Working #golang @binalyze
View GitHub Profile
@yakuter
yakuter / go-mcp-sdk-client.go
Created October 27, 2025 21:24
go-mcp-sdk-client
import (
"context"
"log"
"os/exec"
"github.com/modelcontextprotocol/go-sdk/mcp"
)
func main() {
ctx := context.Background()
@yakuter
yakuter / go-mcp-sdk-server.go
Created October 27, 2025 21:22
go-mcp-sdk-server
import (
"context"
"log"
"github.com/modelcontextprotocol/go-sdk/mcp"
)
type Input struct {
FilePath string `json:"file_path"`
}
@yakuter
yakuter / Test_exit_fatal_panic_3.go
Created December 5, 2024 06:23
Testing Exit, Fatal, and Panic in Golang 3/3
package main
import (
"testing"
)
func TestPanic(t *testing.T) {
defer func() {
r := recover()
if r == nil {
@yakuter
yakuter / Test_exit_fatal_panic_2.go
Last active December 5, 2024 06:23
Testing Exit, Fatal, and Panic in Golang 2/3
package main
import (
"bytes"
"log"
"os"
"testing"
)
func TestLogFatal(t *testing.T) {
@yakuter
yakuter / Test_exit_fatal_panic_1.go
Last active December 5, 2024 06:22
Testing Exit, Fatal, and Panic in Golang 1/3
package main
import (
"bytes"
"fmt"
"os"
"testing"
)
func TestExit(t *testing.T) {
@yakuter
yakuter / test_stdout.go
Created December 5, 2024 06:07
StdoutTest
package main
import (
"bytes"
"fmt"
"io"
"os"
"testing"
)
@yakuter
yakuter / ioReaderRight.go
Created February 15, 2024 21:02
Copy and Movement 11
package main
import (
"fmt"
"io"
"strings"
)
func main() {
reader := strings.NewReader("This is a test message.")
@yakuter
yakuter / ioReaderWrong.go
Created February 15, 2024 20:56
Copy and Movement 10
package main
import (
"fmt"
"io"
"strings"
)
func main() {
reader := strings.NewReader("Test")
@yakuter
yakuter / bufio.go
Created February 15, 2024 20:24
Copy and Movement 9
package main
import (
"bufio"
"fmt"
"os"
)
func main() {
file, err := os.Open("example.txt")
@yakuter
yakuter / bytesBuffer.go
Created February 15, 2024 18:34
Copy and Movement 8
package main
import (
"bytes"
"fmt"
)
func main() {
var buffer bytes.Buffer