This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
) | |
type Int int | |
func (n Int) Equal(m Int) bool { return n == m } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
) | |
func Map[T, U any](values []T, mapper func(T) U) []U { | |
var result []U | |
for _, v := range values { | |
result = append(result, mapper(v)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import "fmt" | |
func main() { | |
ptr := Ptr[bool](false) | |
fmt.Println(ptr) | |
var sum int | |
Apply[int]([]int{10, 20}, func(i, v int) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"errors" | |
"fmt" | |
"reflect" | |
) | |
var ErrNotPointerToString = errors.New("Not a pointer to a string") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Example\Store\Setup; | |
use Magento\Framework\App\Area; | |
use Magento\Framework\App\State; | |
use Magento\Framework\Config\ScopeInterface; | |
use Magento\Framework\Event\ManagerInterface; | |
use Magento\Store\Model\Group; | |
use Magento\Store\Model\GroupFactory; |