Исходники и презентации

This commit is contained in:
2025-05-23 07:26:39 +03:00
parent aa948179d5
commit 02d8430a3a
514 changed files with 13773 additions and 0 deletions

View File

@ -0,0 +1,34 @@
package main
type BaseStorageImpl struct{}
func (s BaseStorageImpl) Close() {}
type SyncStorageImpl struct{}
func (s SyncStorageImpl) Close() {}
func (s SyncStorageImpl) Sync() {}
type BaseStorage interface {
Close()
}
type SyncStorage interface {
Close()
Sync()
}
func main() {
var baseStorage BaseStorage = BaseStorageImpl{}
var syncStorage SyncStorage = SyncStorageImpl{}
println("baseStorage:", baseStorage)
baseStorage = syncStorage
println("baseStorage:", baseStorage)
println("syncStorage:", syncStorage)
syncStorageCasted := syncStorage.(interface{ Close() })
println("syncStorageCasted:", syncStorageCasted)
//syncStorage = baseStorage
}