of other function:
https://github.com/kless/crypt/blob/master/crypt.go#L42
What I do, is to get the md5_crypt, for then to set a different prefix:
https://github.com/kless/crypt/blob/master/apr1_crypt/apr1_crypt.go#L28
where SetSalt in md5_crypt, sets the new values:
https://github.com/kless/crypt/blob/master/md5_crypt/md5_crypt.go#L159
var md5Crypt = md5_crypt.New()
func init() {
md5Crypt.SetSalt(&common.Salt{
MagicPrefix: []byte(MagicPrefix),
})
}
But when I set directly the entire struct, "c.Salt=salt", it is not copying
it like I was expecting, since the MagiPrefix follows being what was in md5:
func (c crypter) SetSalt(salt *common.Salt) {
c.Salt = salt
}
The only way is set it thus:
c.Salt.MagicPrefix = salt.MagicPrefix
===
Now well, if I can set it the next code which is similar (with the exceptionofthe interface),
why is failling in upper code?
* * *
package main
import "fmt"
type foo struct {
s string
i int
}
type bar struct{ Foo *foo }
var foo1 = &foo{
"b",
500,
}
func main() {
_bar := bar{
&foo{
"a",
10,
},
}
fmt.Println(_bar.Foo)
_bar.Foo = foo1
fmt.Println(_bar.Foo)
}
* * *
&{a 10}
&{b 500}
--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.