일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |
- type_traits
- RAII
- haskell
- go
- Functional
- coroutines
- Clojure
- ranges
- Reflect
- Android
- c++
- template
- web
- SHA512
- WebView
- stringprintf
- kotlin
- CustomTab
- async
- Scala
- AES
- Chrono
- sprintf
- design pattern
- SHA1
- ChromeTab
- sha256
- program
- Observer
- traits
- Today
- Total
목록go (3)
프로그래밍 검색 블로그
package main import ( "crypto/aes" "crypto/cipher" "crypto/rand" "encoding/base64" "fmt" "io" ) type AESCipher struct { block cipher.Block } func NewAesCipher(key []byte) (*AESCipher, error) { block, err := aes.NewCipher(key) if err != nil { return nil, err } return &AESCipher{block}, nil } func (a *AESCipher) EncryptString(s string) string { byteString := []byte(s) encryptByteArray := make([]by..
package main import ( "fmt" "reflect" ) type controller struct { } func (c controller) Foo(a int, b string) string { fmt.Println("Foo") return fmt.Sprint(a, b) } func (c controller) Koo(a int, b string) string { fmt.Println("Koo") return fmt.Sprint(a, b) } func (c controller) goo() { //private는 안보임 } //reflection으로 함수 호출할때는 일반 인자 대신 reflect.Value를 넣는다 func valueToReflectionArguments(args ...inte..
go언어의 defer와 거의 비슷하게 제작하였다. C++에서는 finally를 사용할수 있지만 꼭 finally에 넣을수 없는 상황도 있기 때문에아무 함수나 넣을수 있게 하는 defer를 제작12345678910111213141516171819202122232425262728293031323334#include #include templatestruct Defer{ using value_type = _Func; using const_reference = typename std::add_lvalue_reference::type; value_type defer_function; Defer(const_reference f) : defer_function(f){} Defer(value_type&& f) : de..