// You can edit this code!
// Click here and start typing.
package main

import (
	"fmt"
	"log"
)

type matcher func(rune) bool

func main() {
	m := func(r rune) bool {
		defer panic("hahaha")
		if r == 'g' || r == 'o' {
			return true
		}
		// bad code....
		return false
	}
	s, err := sanitize(m, "go is awesome")
	if err != nil {
		log.Fatal(err)
	}
	fmt.Println(s)
}

func sanitize(m matcher, s string) (string, error) {
	var val string

	for _, c := range s {
		if m(c) {
			val = val + "*"
			continue
		}
		val = val + string(c)
	}
	return val, nil
}
