Function | Object reference | Return value | Is extension function |
let | it | Lambda result | Yes |
run | this | Lambda result | Yes |
run | - | Lambda result | No: called without the context object |
with | this | Lambda result | No: takes the context object as an argument. |
apply | this | Context object | Yes |
also | it | Context object | Yes |
다른 블로그 봤는데 이해가 안돼서 정리할려고 티스토리 켜고 공식문서 펼쳐봤는데
공식문서 설명이 젤 쉽네.. 심지어 영어인데, 그냥 저 표로 끝!
https://kotlinlang.org/docs/scope-functions.html#function-selection
takeIf, takeUnless 도 잘 써먹자!
'개발 팁' 카테고리의 다른 글
k8s private registry 에서 docker repository 삭제하기 (0) | 2024.06.20 |
---|---|
SpringBoot 3 (Spring 6.x) Error Response Formatting (0) | 2024.04.02 |
Microk8s docker image/tag 목록 확인하기 (0) | 2024.02.23 |
이미 helm으로 설치한 mongodb/redis password 변경하기 (0) | 2024.02.23 |
Spring Boot + Swagger + Keycloak Integration (1) | 2020.11.12 |