Tag:Interface type

  • Understand covariance and inversion in c# generic interfaces

    Time:2022-4-3

    Recently, I read the book c# advanced programming (Ninth Edition) and saw the chapter of generic interface. I didn’t quite understand about covariance and inversion. I talked a little bit. I checked a lot of information on the Internet and finally got it (feeling) clear. Come here to record it. 1、 What are covariance and […]

  • Annotation implementation mechanism of mybatis

    Time:2022-4-2

    When we use mybatis, we usually create an XML file corresponding to mapper to write SQL statements. This method is also officially recommended and the most flexible. But in fact, mybatis also supports the implementation of SQL statements through annotations. This article is about how mybatis uses annotation to implement SQL execution. Knowledge points What […]

  • 31. Talk about the empty interface in go language

    Time:2022-2-7

    Hi, Hello, I’m brother Ming. During my time of learning Golang, I wrote detailed study notes on my personal WeChat official account “Go programming time”. For Go language, I am also a beginner, so writing things should be more suitable for students who are just in contact. If you are just learning Go language, do […]

  • Study hard go: 15 Interface

    Time:2022-1-30

    Series articles: Study hard go: 1 Learning lead Study hard go: 2 Environment construction Study hard go: 3 Environment construction – gomod learning Study hard go: 4 Variables and data types Study hard go: 5 Constants and operators Study hard go: 6 Process control Study hard go: 7 Built in collection array Study hard go: […]

  • Golang implements the conversion of interface type to string type

    Time:2022-1-27

    Look at the code~ //Strval gets the string value of the variable //Floating point 3.0 will be converted to string 3, “3” //Variables that are not numeric or character types will be converted to JSON format strings func Strval(value interface{}) string { var key string if value == nil { return key } switch value.(type) […]

  • 35. Three “hidden rules” about interfaces in go language

    Time:2022-1-25

    Hi, Hello, I’m brother Ming. During my time of learning Golang, I wrote detailed study notes on my personal WeChat official account “Go programming time”. For Go language, I am also a beginner, so writing things should be more suitable for students who are just in contact. If you are just learning Go language, do […]

  • 36. Illustration: there is nothing difficult about the three laws of reflection in go language

    Time:2022-1-18

    Hi, everyone, I’m brother Ming. During my time of learning Golang, I wrote detailed study notes on my personal WeChat official account “Go programming time”. For Go language, I am also a beginner, so writing things should be more suitable for students who are just in contact. If you are just learning Go language, do […]

  • Viper parsing & loading configuration

    Time:2022-1-4

    Viper parsing & loading configuration 1. What is Viper Viper is a library that facilitates go language applications to process configuration information. It can handle configurations in a variety of formats. Features it supports: Set defaults Read configuration data from JSON, toml, yaml, HCl, and Java properties files You can monitor the changes of the […]

  • Learn c# (basic types) again

    Time:2021-12-19

    Do you really know the basic types? C # type classification Value type Reference type (object, string), other than value type Note: The interface type (declared with interface) can be implemented by the value type (struct) The value of a variable is stored in its declared location. Generally speaking, the reference type is allocated from […]

  • [go time] empty interface in go language

    Time:2021-12-11

    What is an empty interface? Empty interfaces are special interface types. Ordinary interfaces have methods, but empty interfaces do not define any methods. Therefore, we can say that all types implement at least empty interfaces. type empty_iface interface { } Each interface contains two properties, one is value and the other is type. For empty […]

  • Go error handling

    Time:2021-12-4

    Go error handling Error type is an interface type. This is its definition: type error interface { Error() string } Go catch exception Traditional methods of catching exceptions try catch finally Go language Defer, panic and recover are introduced 1. Go program throws a panic exception, catches the exception through recover in defer, and then […]

  • [go] interface type in memory

    Time:2021-11-21

    preface In the abstract, an interface is a convention, a constraint, and a protocol. stayGoIn a language, an interface is a syntax type used to define a programming specification. In go language, there are two main types of interfaces: Empty interface without method definition Non empty interface with method definition Previously, there were two graphic […]